Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.5.0
-
None
Description
When using moveTo to move a directory the isCopyOnItself check fails if the directory name starts the same but is different. Example:
Source:
/storage/emulated/0/GalileoMobile
Destination:
/storage/emulated/0/GalileoMobileBackup/GalileoMobile
The issue is with the indexof check looking for any slash following the partial match.
Existing Line 305 of LocalFileSystem.java:
if (dest.startsWith(src) && dest.indexOf(File.separator, src.length() - 1) != -1) {
Something like this should work:
if (dest.equals(src) || dest.startsWith(src + File.separator) ) {
This would also occur with copies.