cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Good (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-7602) isCopyOnItself check fails when moving directory
Date Fri, 19 Sep 2014 17:54:33 GMT
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)

Mime
View raw message