Java .isDirectory() return true also on file without extension?

Works properly on my Windows7, JDK 6. Try upgrading your JRE/JDK and double-check if you don't have a directory with the same name. I used this snippet to check.

Works properly on my Windows7, JDK 6. Try upgrading your JRE/JDK and double-check if you don't have a directory with the same name. I used this snippet to check: File file = new File("C:\\tomcat\\apache-tomcat-7.0.20\\LICENSE"); System.out.

Println(file.isDirectory()); // prints false.

I've tried Windows 7 32 bit, 64 bit with JDK 6 and 7 and on both of those it works absolutely fine for me. Can't find any bug reports of this nature around either, what code are you using? I very much doubt this is a bug that's gone undiscovered up until now!

Perhaps the directory contains both a file with extension and a directory with the same name but without extension. Then configure the Windows file explorer to hide the extension, think that that is displayed is the real and full name of the file, put that into some test code ... Bingo.

1 I'd believe that before I'd believe isDirectory() was ever (meaningfully) broken, that's for sure! – Dave Newton Oct 6 at 17:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions