The local sync copies the files directly to the destination directory. If the application is terminated before the sync is complete, it will not resume the next time the application starts - e.g. the application has no way to figure out that the copy was incomplete.
suggest:
copy to temporary sibling directory
after completion do a rename, rename, delete action: old.renameTo(trash); new.renameTo(old); trash.delete();
The local sync copies the files directly to the destination directory. If the application is terminated before the sync is complete, it will not resume the next time the application starts - e.g. the application has no way to figure out that the copy was incomplete.
suggest:
old.renameTo(trash); new.renameTo(old); trash.delete();