Browse Source

Refactor the check of last character of an OCFile parent path

Juan Carlos González Cabrero 9 years ago
parent
commit
bd96e2c9ce
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/com/owncloud/android/datamodel/OCFile.java

+ 1 - 1
src/com/owncloud/android/datamodel/OCFile.java

@@ -444,7 +444,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
      */
     public String getParentRemotePath() {
         String parentPath = new File(getRemotePath()).getParent();
-        return (parentPath.substring(parentPath.length() - 1).equals("/")) ? parentPath : (parentPath + "/");
+        return (parentPath.endsWith("/")) ? parentPath : (parentPath + "/");
     }
 
     /**