Skip to content

Commit

Permalink
recursive mode of copyFilesFromDirectory did not copy directories if …
Browse files Browse the repository at this point in the history
…they already exist on the destination

originally reported by @gavineadie
  • Loading branch information
darkv committed Dec 3, 2013
1 parent 5ffe965 commit cdb86a4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1023,10 +1023,11 @@ public static void copyFilesFromDirectory(File srcDirectory,
if (deleteOriginals) {
renameTo(srcFile, dstFile);
} else {
if (dstFile.mkdirs())
if (dstFile.exists() || dstFile.mkdirs()) {
copyFilesFromDirectory(srcFile, dstFile, deleteOriginals, replaceExistingFiles, recursiveCopy, filter);
else
} else {
log.error("Error creating directories for destination \""+dstDirectory.getPath()+"\"");
}
}
} else if (!srcFile.isDirectory()) {
if (replaceExistingFiles || ! dstFile.exists()) {
Expand Down

0 comments on commit cdb86a4

Please sign in to comment.