title: Java Files.exists() returns false even if the file exists
body: <p>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.</p>
  
  <p>The txt file contains this:</p>
  
  <pre><code>port=80
  directory=c:\www
  index=index.html
  listing=true
  connexions=5
  </code></pre>
  
  <p>I checked the files permissions and it doesn't seem to be blocked.
  I tried both <code>.exists()</code> and <code>getAbsoluteFile().Exists()</code>and both return false
  Here if the code for reading in the file:</p>
  
  <pre><code>try {
      BufferedReader br = new BufferedReader(new FileReader(config));
  
      while((line = br.readLine()) != null){
          tokens = line.split("=");
          if(tokens.length &gt; 1) {
              switch (tokens.length) {
                  case 0:
                      if (Integer.parseInt(tokens[1]) &gt; 0 &amp;&amp; Integer.parseInt(tokens[1]) &lt; 65535) {
                          portNumber = Integer.parseInt(tokens[1]);
                          param++;
                      } else {
                          System.err.println("Port in config file is invalid.");
                          System.exit(1);
                      }
                      break;
                  case 1:
                      File check = new File(tokens[1]);
                      if (check.getAbsoluteFile().exists()) {
                          rootPath = path ? args[1] : tokens[1];
                          param++;
                      } else {
                          System.err.println("Specified directory doesn't exist in config file");
                          System.exit(1);
                      }
                      break;
                  case 2:
                      File checkFile = new File(rootPath + "\\" + tokens[1]);
                      if (checkFile.getAbsoluteFile().exists()) {
                          indexFile = tokens[1];
                          param++;
                      } else {
                          System.err.println("Index file in config file doesn't exist.");
                          System.exit(1);
                      }
                      break;
                  case 3:
                      if (tokens[1].toLowerCase().equals("true") || tokens[1].toLowerCase().equals("false")) {
                          list = tokens[1].equals("true");
                          param++;
                      } else {
                          System.err.println("Can't validate the list parameter in config file.");
                          System.exit(1);
                      }
                      break;
                  case 4:
                      if (Integer.parseInt(tokens[1]) &gt; 0) {
                          connNumber = Integer.parseInt(tokens[1]);
                          param++;
                      } else {
                          System.err.println("Number of connexions in config file is invalid.");
                          System.exit(1);
                      }
                      break;
                  default:
                      break;
              }
          }
          else{
              System.err.println("Missing arguments in config file.");
              System.exit(1);
          }
  
      }
  </code></pre>