Fixed synchroniser deleting source directory
This commit is contained in:
@@ -15,16 +15,11 @@ public class ApacheCommonsIOSynchroniser implements Synchroniser {
|
||||
source = Path.of(root.getPath(), dest.getPath()).toFile();
|
||||
}
|
||||
|
||||
if (source.exists() && dest.exists()) {
|
||||
dest.delete();
|
||||
// Fixes an issue where sometimes, Apache Commons IO will fail to overwrite.
|
||||
}
|
||||
|
||||
if (source.isDirectory()) {
|
||||
if (dest.isDirectory()) {
|
||||
FileUtils.copyDirectory(source, dest);
|
||||
} else {
|
||||
throw new IOException("Cannot synchronise directy to non-directory!");
|
||||
throw new IOException("Cannot synchronise directory to non-directory!");
|
||||
// TODO add more detail to error message.
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user