/** * Copy the source file to the target file. * @param sourceFile The source file to copy from * @param targetFile The target file to copy to * @throws FileAlreadyExistsException Thrown if the target file already * exists. This exception is a subclass of IOException, so catching * an IOException is enough if you don't care about this specific reason. * @throws IOException Thrown if an error during the copy */ public static void copy(File sourceFile, File targetFile) throws FileAlreadyExistsException, IOException { copy(sourceFile, targetFile, false); }
/** * Copy the source file to the target file. * @param sourceFile The source file to copy from * @param targetFile The target file to copy to * @throws FileAlreadyExistsException Thrown if the target file already * exists. This exception is a subclass of IOException, so catching * an IOException is enough if you don't care about this specific reason. * @throws IOException Thrown if an error during the copy */ public static void copy(File sourceFile, File targetFile) throws FileAlreadyExistsException, IOException { copy(sourceFile, targetFile, false); }