Skip to content

Instantly share code, notes, and snippets.

@theresajayne
Created August 9, 2011 15:05
Show Gist options
  • Save theresajayne/1134303 to your computer and use it in GitHub Desktop.
Save theresajayne/1134303 to your computer and use it in GitHub Desktop.
*/
public static void copyFolderContents(File srcFolder, File dstFolder, boolean preserveFileDates) throws Exception {
try {
if (srcFolder.isDirectory()) {
org.apache.commons.io.FileUtils.copyDirectory(srcFolder, dstFolder, preserveFileDates); <--- Error here
}
} catch(Exception e) {
logger.error("Failed to copy contents of folder:[" +
srcFolder.getAbsolutePath() + "] to folder [" +
dstFolder.getAbsolutePath() + "].", e
);
throw e;
}
}
extract from pom
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>20030203.000550</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>20030805.205232</version>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment