You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Tom Good (JIRA)" <ji...@apache.org> on 2014/09/19 19:54:33 UTC

[jira] [Created] (CB-7602) isCopyOnItself check fails when moving directory

Tom Good created CB-7602:
----------------------------

             Summary: isCopyOnItself check fails 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
            Priority: Minor


When using moveTo to move a directory the isCopyOnItself check fails if the directory name starts the same.  Example:

Source:
/storage/emulated/0/GalileoMobile
Destination:
/storage/emulated/0/GalileoMobileBackup/GalileoMobile

The issue is with the indexof check looking for any slash.
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)