[ 
https://issues.apache.org/jira/browse/CB-7602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ian Clelland resolved CB-7602.
------------------------------
    Resolution: Fixed

Fixed now; tests added. Should be in the next (1.3.2) release of File.

> isCopyOnItself check returns invalid result when moving directory
> -----------------------------------------------------------------
>
>                 Key: CB-7602
>                 URL: https://issues.apache.org/jira/browse/CB-7602
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File
>    Affects Versions: 3.5.0
>            Reporter: Tom Good
>            Assignee: Ian Clelland
>              Labels: copyTo, moveTo
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to