vendredi 29 avril 2016

Java Files.exists() returns false even if the file exists

I'm doing a web server and it has to read a txt config file and to assign a port number, directory, the default index.html file, etc, but when it checks for the index.html it keeps saying it doesn't exist even though the file does exist.

The txt file contains this:

port=80
directory=c:\www
index=index.html
listing=true
connexions=5

I checked the files permissions and it doesn't seem to be blocked. Here is the code for when it reads the file: http://ift.tt/24quZFR

I tried both .exists() and getAbsoluteFile().Exists()and both return false




Aucun commentaire:

Enregistrer un commentaire