Merge branch 'develop' into SettingsGreyedOut
[pub/Android/ownCloud.git] / src / com / owncloud / android / utils / FileStorageUtils.java
index de1a320..b462cd9 100644 (file)
@@ -93,6 +93,20 @@ public class FileStorageUtils {
         String value = uploadPath + OCFile.PATH_SEPARATOR +  (fileName == null ? "" : fileName);
         return value;
     }
+
+    /**
+     * Gets the composed path when video is or must be stored
+     * @param context
+     * @param fileName: video file name
+     * @return String: video file path composed
+     */
+    public static String getInstantVideoUploadFilePath(Context context, String fileName) {
+        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
+        String uploadVideoPathdef = context.getString(R.string.instant_upload_path);
+        String uploadVideoPath = pref.getString("instant_video_upload_path", uploadVideoPathdef);
+        String value = uploadVideoPath + OCFile.PATH_SEPARATOR +  (fileName == null ? "" : fileName);
+        return value;
+    }
     
     public static String getParentPath(String remotePath) {
         String parentPath = new File(remotePath).getParent();
@@ -139,7 +153,7 @@ public class FileStorageUtils {
     /**
      * Sorts all filenames, regarding last user decision 
      */
-    public static Vector<OCFile> sortDirectory(Vector<OCFile> files){
+    public static Vector<OCFile> sortFolder(Vector<OCFile> files){
         switch (mSortOrder){
         case 0:
             files = FileStorageUtils.sortByName(files);