CB-4514: Making DirectoryCopy Recursive
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/995270e1 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/995270e1 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/995270e1 Branch: refs/heads/master Commit: 995270e1f1078cf313aa1d17a09472b399f4f909 Parents: c242926 Author: Joe Bowser <[email protected]> Authored: Wed Sep 4 15:39:13 2013 -0700 Committer: Joe Bowser <[email protected]> Committed: Wed Sep 4 15:39:13 2013 -0700 ---------------------------------------------------------------------- src/android/FileUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/995270e1/src/android/FileUtils.java ---------------------------------------------------------------------- diff --git a/src/android/FileUtils.java b/src/android/FileUtils.java index 892c12c..1c99c38 100755 --- a/src/android/FileUtils.java +++ b/src/android/FileUtils.java @@ -487,12 +487,13 @@ public class FileUtils extends CordovaPlugin { throw new NoModificationAllowedException("Couldn't create the destination directory"); } } + for (File file : srcDir.listFiles()) { + File destination = new File(destinationDir.getAbsoluteFile() + File.separator + file.getName()); if (file.isDirectory()) { - copyDirectory(file, destinationDir); + copyDirectory(file, destination); } else { - File destination = new File(destinationDir.getAbsoluteFile() + File.separator + file.getName()); copyFile(file, destination); } }
