瀏覽代碼

Refactor the check of last character of an OCFile parent path

Juan Carlos González Cabrero 9 年之前
父節點
當前提交
bd96e2c9ce
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 + "/");
     }
 
     /**