Merge branch 'develop' into refactor_remote_operation_to_create_folder
[pub/Android/ownCloud.git] / src / com / owncloud / android / utils / FileStorageUtils.java
index 5539952..2520644 100644 (file)
@@ -19,15 +19,16 @@ package com.owncloud.android.utils;
 
 import java.io.File;
 
 
 import java.io.File;
 
+import com.owncloud.android.MainApp;
+import com.owncloud.android.R;
+import com.owncloud.android.datamodel.OCFile;
+
 import android.annotation.SuppressLint;
 import android.content.Context;
 import android.net.Uri;
 import android.os.Environment;
 import android.os.StatFs;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
 import android.net.Uri;
 import android.os.Environment;
 import android.os.StatFs;
 
-import com.owncloud.android.MainApp;
-import com.owncloud.android.R;
-import com.owncloud.android.datamodel.OCFile;
 
 /**
  * Static methods to help in access to local file system.
 
 /**
  * Static methods to help in access to local file system.
@@ -75,5 +76,11 @@ public class FileStorageUtils {
         String value = uploadPath + OCFile.PATH_SEPARATOR +  (fileName == null ? "" : fileName);
         return value;
     }
         String value = uploadPath + OCFile.PATH_SEPARATOR +  (fileName == null ? "" : fileName);
         return value;
     }
+    
+    public static String getParentPath(String remotePath) {
+        String parentPath = new File(remotePath).getParent();
+        parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : parentPath + OCFile.PATH_SEPARATOR;
+        return parentPath;
+    }
   
 }
\ No newline at end of file
   
 }
\ No newline at end of file