diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index 11c70a29a3..a1366e1e2c 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -724,6 +724,23 @@ public class FileDataStorageManager { 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); + } + } } ArrayList operations = new ArrayList<>(cursor.getCount()); diff --git a/src/com/owncloud/android/utils/ErrorMessageAdapter.java b/src/com/owncloud/android/utils/ErrorMessageAdapter.java index f2a36d5c52..4728ceed45 100644 --- a/src/com/owncloud/android/utils/ErrorMessageAdapter.java +++ b/src/com/owncloud/android/utils/ErrorMessageAdapter.java @@ -312,5 +312,6 @@ public class ErrorMessageAdapter { code == ResultCode.TIMEOUT || code == ResultCode.HOST_NOT_AVAILABLE; } + } } } diff --git a/src/com/owncloud/android/utils/FileStorageUtils.java b/src/com/owncloud/android/utils/FileStorageUtils.java index c6e9093cee..cb3bee7895 100644 --- a/src/com/owncloud/android/utils/FileStorageUtils.java +++ b/src/com/owncloud/android/utils/FileStorageUtils.java @@ -291,7 +291,7 @@ public class FileStorageUtils { List files = new ArrayList(Arrays.asList(filesArray)); Collections.sort(files, new Comparator() { - @SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level") + @SuppressFBWarnings(value = "Bx") public int compare(File o1, File o2) { Long obj1 = o1.lastModified(); return multiplier * obj1.compareTo(o2.lastModified()); @@ -309,7 +309,7 @@ public class FileStorageUtils { final int multiplier = mSortAscending ? 1 : -1; Collections.sort(files, new Comparator() { - @SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level") + @SuppressFBWarnings(value = "Bx") public int compare(OCFile o1, OCFile o2) { if (o1.isFolder() && o2.isFolder()) { Long obj1 = o1.getFileLength(); @@ -338,7 +338,7 @@ public class FileStorageUtils { List files = new ArrayList(Arrays.asList(filesArray)); Collections.sort(files, new Comparator() { - @SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level") + @SuppressFBWarnings(value = "Bx") public int compare(File o1, File o2) { if (o1.isDirectory() && o2.isDirectory()) { Long obj1 = getFolderSize(o1); @@ -362,7 +362,7 @@ public class FileStorageUtils { * Sorts list by Name * @param files files to sort */ - @SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level") + @SuppressFBWarnings(value = "Bx") public static Vector sortOCFilesByName(Vector files){ final int multiplier = mSortAscending ? 1 : -1;