I'm simply trying to find whether an XML file exists or not. I have this code:
File f = new File("customers/jim.xml");
File g = new File("customers/jim.txt");
if(f.exists())
{
System.out.println("File f exists!");
}
else
{
System.out.println("File f not found!");
}
if(g.exists())
{
System.out.println("File g exists!");
}
else
{
System.out.println("File g not found!");
}
The output:
File f not found!
File g exists!
The text file is found, the xml one not. Both files are in the same folder, and the spelling is indeed correct. Anyone know what I'm doing wrong?
customersdirectory?.xml. if you are using linux: is the character casing correct?