In Windows os, I have a file, for example "README" .
Using java, File("readme").exists()
will return true
How to get the true file name, something like this:
new File("readme").getTrueFileName() //return "README"
Look at File.getCanonicalPath
- that returns the "real" filename.
There's also File.getCanonicalFile
which returns the same information but as a File
object.
(I've just tested this with your exact situation, and it works fine.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With