code: @SuppressWarnings("resource")
  	public static void copyFile(File from, File to, boolean overwrite)
  			throws RuntimeIOException {
  		FileChannel inputChannel = null;
  		FileChannel outputChannel = null;
  		try {
  			if (!from.exists())
  				throw new RuntimeIOException.FileNotFound(from);
  			if (to.isDirectory()) {
  				to = new File(to.getPath() + File.separator + from.getName());
  			}
  			if (to.exists()) {
  				if (!overwrite)
  					throw new RuntimeIOException.FileAlreadyExists(to);
  			} else if (!to.createNewFile())
  				throw new RuntimeIOException.FailedToCreate(to);
  
  			inputChannel = new FileInputStream(from).getChannel();
  			outputChannel = new FileOutputStream(to).getChannel();
  			long size = inputChannel.size();
  			long copied = 0L;
  			while (copied < size)
  				copied += outputChannel.transferFrom(inputChannel, copied, size
  						- copied);
  		} catch (java.io.IOException e) {
  			throw new RuntimeIOException(e.getMessage(), e);
  		} finally {
  			closeChannels(inputChannel, outputChannel);
  		}
  	}
docs: Creates a copy of a file.
  
  If the destination is a directory the file is copied to that directory
  with the same name as the source file.
  
  @param from
  - source File
  @param to
  - destination File
  @param overwrite
  - allow overwriting existing file
  
  @throws RuntimeIOException