if (c != null && c.moveToFirst()) {
remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
//ThumbnailsCacheManager.removeFileFromCache(remoteId);
+ c.close();
}
Log_OC.d(TAG, "Removing FILE " + remoteId);
+ uri.getPathSegments().get(1)
+ (!TextUtils.isEmpty(where) ? " AND (" + where
+ ")" : ""), whereArgs);
- /* just for log
- if (c!=null) {
- c.close();
- }
- */
break;
case DIRECTORY:
// deletion of folder is recursive
// ugly patch; serious refactorization is needed to reduce work in
// FileDataStorageManager and bring it to FileContentProvider
if (doubleCheck == null || !doubleCheck.moveToFirst()) {
+ if (doubleCheck != null) {
+ doubleCheck.close();
+ }
long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
if (rowId > 0) {
Uri insertedFileUri =
// ugly patch; serious refactorization is needed to reduce work in
// FileDataStorageManager and bring it to FileContentProvider
if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
+ if (doubleCheckShare != null) {
+ doubleCheckShare.close();
+ }
long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
if (rowId >0) {
insertedShareUri =
// get accounts from AccountManager ; we can't be sure if accounts in it are updated or not although
// we know the update was previously done in {link @FileActivity#onCreate} because the changes through
// AccountManager are not synchronous
- Account[] accounts = AccountManager.get(getContext()).getAccountsByType(
+ Account[] accounts = AccountManager.get(getContext()).getAccountsByType(
MainApp.getAccountType());
String serverUrl, username, oldAccountName, newAccountName;
for (Account account : accounts) {
db.endTransaction();
}
}
- } catch (Exception e) {
- Log_OC.e(TAG, "Exception upgrading account names or paths in database", e);
- }
+ } catch (Exception e) {
+ Log_OC.e(TAG, "Exception upgrading account names or paths in database", e);
+ }
}