title: Unable to copy a .png file to a folder using java (.png/screenshot file generated by selenium) on Win7 machine
body: <p>I have a screenshot generated through selenium for a failed test and I am trying to save it to a folder. But I am getting a java error saying</p>
  
  <blockquote>
  java.io.IOException: The filename, directory name, or volume label syntax is incorrect
      at java.io.WinNTFileSystem.canonicalize0(Native Method)
      at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)
      at java.io.File.getCanonicalPath(File.java:589)
      at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1009)
      at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:968)
      .................
  </blockquote>
  
  <p>I am using the following code</p>
  
  <pre><code>    public void saveScreenShot(TestResult result) throws ClassNotFoundException, SQLException
  {
      String actualId = result.getActualId();
      actualId = actualId.replace("/", "-");
  
      String fileName = String.format(ConfigurationManager.getScreenshotDirectory() + "\\%d&amp;%s.jpg", result.getTestId(), actualId);
  
      try
      {
          FileUtils.copyFile(getScreenShot(), new File(fileName));
      }
      catch (IOException e)
      {
          e.printStackTrace();
      }
  </code></pre>