- db.beginTransaction();
- try {
- ContentValues cv = new ContentValues();
- cv.put(ProviderTableMeta.FILE_STORAGE_PATH, newPath);
- db.update(ProviderTableMeta.FILE_TABLE_NAME,
- cv,
- ProviderTableMeta.FILE_STORAGE_PATH + "=?",
- new String[]{oldPath});
- upgraded = true;
- db.setTransactionSuccessful();
-
- Log_OC.d("SQL", "Updated downloaded files: old file name == " + oldPath +
- ", new file name == " + newPath);
- } catch (SQLException e) {
- upgraded = false;
- } finally {
- db.endTransaction();
- }
- upgradedResult = upgraded && upgradedResult;
-
-// // move file
-// File oldFile = new File(oldPath);
-// renamed = false;
-// if (oldFile.exists()) {
-// File newFile = new File(newPath);
-// File newFolder = newFile.getParentFile();
-// if (!newFolder.exists()) {
-// newFolder.mkdirs();
-// }
-// renamed = oldFile.renameTo(newFile);
-// }
- } while (c.moveToNext());
+ ContentValues cv = new ContentValues();
+ cv.put(ProviderTableMeta.FILE_STORAGE_PATH, newPath);
+ db.update(ProviderTableMeta.FILE_TABLE_NAME,
+ cv,
+ ProviderTableMeta.FILE_STORAGE_PATH + "=?",
+ new String[]{oldPath});
+
+ Log_OC.v("SQL", "Updated path of downloaded file: old file name == " + oldPath +
+ ", new file name == " + newPath);