/** * Copy recursively the contents of <code>sourceDirectory</code> to * the <code>targetDirectory</code>. Note that <code>sourceDirectory</code> * will <b>NOT</b> be copied. If <code>targetDirectory</code> does not exist, it will be created. * @param sourceDirectory The source directory to copy * @param targetDirectory The target directory to copy to * @throws Exception If the source directory does not exist. * @since 4.3 */ public static void copyDirectoryContentsRecursively(File sourceDirectory, File targetDirectory) throws Exception { copyRecursively(sourceDirectory, targetDirectory, false); }
/** * Copy recursively the <code>sourceDirectory</code> and all its contents * to the <code>targetDirectory</code>. If <code>targetDirectory</code> * does not exist, it will be created. * @param sourceDirectory The source directory to copy * @param targetDirectory The target directory to copy to * @throws Exception If the source directory does not exist. * @since 4.3 */ public static void copyDirectoriesRecursively(File sourceDirectory, File targetDirectory) throws Exception { copyRecursively(sourceDirectory, targetDirectory, true); }
/** * Copy recursively the contents of <code>sourceDirectory</code> to * the <code>targetDirectory</code>. Note that <code>sourceDirectory</code> * will <b>NOT</b> be copied. If <code>targetDirectory</code> does not exist, it will be created. * @param sourceDirectory The source directory to copy * @param targetDirectory The target directory to copy to * @throws Exception If the source directory does not exist. * @since 4.3 */ public static void copyDirectoryContentsRecursively(File sourceDirectory, File targetDirectory) throws Exception { copyRecursively(sourceDirectory, targetDirectory, false); }
/** * Copy recursively the <code>sourceDirectory</code> and all its contents * to the <code>targetDirectory</code>. If <code>targetDirectory</code> * does not exist, it will be created. * @param sourceDirectory The source directory to copy * @param targetDirectory The target directory to copy to * @throws Exception If the source directory does not exist. * @since 4.3 */ public static void copyDirectoriesRecursively(File sourceDirectory, File targetDirectory) throws Exception { copyRecursively(sourceDirectory, targetDirectory, true); }
if (srcFile.isDirectory()) { File childTargetDir = new File(targetDir.getAbsolutePath()); copyRecursively(srcFile, childTargetDir, true); } else { copy(srcFile.getAbsolutePath(), targetDir.getAbsolutePath() + File.separatorChar + srcFile.getName());
if (srcFile.isDirectory()) { File childTargetDir = new File(targetDir.getAbsolutePath()); copyRecursively(srcFile, childTargetDir, true); } else { copy(srcFile.getAbsolutePath(), targetDir.getAbsolutePath() + File.separatorChar + srcFile.getName());