Browse Source

Fixes after rebase

AndyScherzinger 8 years ago
parent
commit
0d0321b001

+ 12 - 29
src/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -705,42 +705,25 @@ public class FileDataStorageManager {
     }
 
     public void migrateStoredFiles(String srcPath, String dstPath) throws Exception {
-        Cursor cursor = null;
-        if (getContentResolver() != null) {
-            cursor = getContentResolver().query(ProviderTableMeta.CONTENT_URI_FILE,
-                    null,
-                    ProviderTableMeta.FILE_STORAGE_PATH  + " IS NOT NULL",
-                    null,
-                    null);
+        Cursor cursor;
+        try {
+            if (getContentResolver() != null) {
+                cursor = getContentResolver().query(ProviderTableMeta.CONTENT_URI_FILE,
+                        null,
+                        ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL",
+                        null,
+                        null);
 
-        } else {
-            try {
+            } else {
                 cursor = getContentProviderClient().query(ProviderTableMeta.CONTENT_URI_FILE,
                         new String[]{ProviderTableMeta._ID, ProviderTableMeta.FILE_STORAGE_PATH},
                         ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL",
                         null,
                         null);
-            } catch (RemoteException e) {
-                Log_OC.e(TAG, e.getMessage(), e);
-                throw e;
-            }
-        } catch (IOException ex) {
-            ret = false;
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    Log_OC.d(TAG, e.getMessage(), e);
-                }
-            }
-            if (out != null) {
-                try {
-                    out.close();
-                } catch (IOException e) {
-                    Log_OC.d(TAG, e.getMessage(), e);
-                }
             }
+        } catch (RemoteException e) {
+            Log_OC.e(TAG, e.getMessage(), e);
+            throw e;
         }
 
         ArrayList<ContentProviderOperation> operations = new ArrayList<>(cursor.getCount());

+ 0 - 2
src/com/owncloud/android/utils/ErrorMessageAdapter.java

@@ -311,7 +311,5 @@ public class ErrorMessageAdapter {
         return code == ResultCode.WRONG_CONNECTION ||
                 code == ResultCode.TIMEOUT ||
                 code == ResultCode.HOST_NOT_AVAILABLE;
-        }
-        }
     }
 }