title: Creating a file is causing problem, the File.getPath() doesn't seem to work
body: <p>I am trying to create a back up file for an html file on a web server.</p>
  
  <p>I want the backup to be in the same location as the existing file (it's a quick fix). I want to create the file using File file = new File(PathName);</p>
  
  <pre><code>public void backUpOldPage(String oldContent) throws IOException{
              // this.uri is a class variable with the path of the file to be backed up
      String fileName = new File(this.uri).getName();
      String pathName = new File(this.uri).getPath();
      System.out.println(pathName);
      String bckPath = pathName+"\\"+bckName;
  
      FileOutputStream fout;      
  
      try
      {
          // Open an output stream
          fout = new FileOutputStream (bckFile);
          fout.close();       
      }
      // Catches any error conditions
      catch (IOException e)
      {
          System.err.println ("Unable to write to file");
          System.exit(-1);
      }
  }
  </code></pre>
  
  <p>But if instead I was to set bckPath like this, it will work.</p>
  
  <pre><code>String bckPath = "C://dev/server/tomcat6/webapps/sample-site/index_sdjf---sd.html";
  </code></pre>
  
  <p>I am working on Windows, not sure if that makes a difference.</p>
  
  <p>The result of String bckPath = pathName+"\"+bckName;
  is bckPath = C:\dev\server\tomcat6\webapps\sample-site\filename.html - this doesn't result in a new file.</p>