Эх сурвалжийг харах

Refactor the check of last character of an OCFile parent path

Juan Carlos González Cabrero 9 жил өмнө
parent
commit
bd96e2c9ce

+ 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 + "/");
     }
 
     /**