Reputation: 7838
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?
Upvotes: 0
Views: 2171
Reputation: 118
Everything looks correct so a few things to check:
Upvotes: 3