code: public static void copyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
  		if (srcFile == null) {
  			throw new IllegalArgumentException("Source must not be null");
  		}
  		if (destFile == null) {
  			throw new IllegalArgumentException("Destination must not be null");
  		}
  		if (srcFile.exists() == false) {
  			throw new FileNotFoundException("Source '" + srcFile + "' does not exist");
  		}
  		if (srcFile.isDirectory()) {
  			throw new IOException("Source '" + srcFile + "' exists but is a directory");
  		}
  		if (srcFile.getCanonicalPath().equals(destFile.getCanonicalPath())) {
  			throw new IOException("Source '" + srcFile + "' and destination '" + destFile + "' are the same");
  		}
  		if (destFile.getParentFile() != null && destFile.getParentFile().exists() == false) {
  			if (destFile.getParentFile().mkdirs() == false) {
  				throw new IOException("Destination '" + destFile + "' directory cannot be created");
  			}
  		}
  		if (destFile.exists() && destFile.canWrite() == false) {
  			throw new IOException("Destination '" + destFile + "' exists but is read-only");
  		}
  		doCopyFile(srcFile, destFile, preserveFileDate);
  	}
docs: Copies a file to a new location.
  <p>
  This method copies the contents of the specified source file to the
  specified destination file. The directory holding the destination file is
  created if it does not exist. If the destination file exists, then this
  method will overwrite it.
  
  @param srcFile
  an existing file to copy, must not be <code>null</code>
  @param destFile
  the new file, must not be <code>null</code>
  @param preserveFileDate
  true if the file date of the copy should be the same as the
  original
  
  @throws NullPointerException
  if source or destination is <code>null</code>
  @throws IOException
  if source or destination is invalid
  @throws IOException
  if an IO error occurs during copying
  @see #copyFileToDirectory(File, File, boolean)