title: Copying a file results in java.io.FileNotFoundException (Access is Denied) from output
body: <pre><code>File file1 = new File(file.getAbsoluteFile() + "/example/directory/example.png");
  file1.mkdirs();
  file1.setWritable(true);
  file1.createNewFile();
  try {
      FileInputStream is = new FileInputStream(exampleInputDirectory);
      FileOutputStream os = new FileOutputStream(file1);
      FileChannel srcChannel = is.getChannel();
      FileChannel dstChannel = os.getChannel();
      dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
      is.close();
      os.close();
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>This is my setup for copying an image file to a new directory tree.  However, when this code is executed I get the following:</p>
  
  <pre><code>java.io.FileNotFoundException: *points to output directory* (Access is denied)
  </code></pre>
  
  <p>Have I gone about creating <code>file1</code> incorrectly?</p>