- if (wdc.downloadFile(mRemotePath, file)) {\r
- ContentValues cv = new ContentValues();\r
- cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getAbsolutePath());\r
- getContentResolver().update(\r
+ File newFile = null;\r
+ if (wdc.downloadFile(mRemotePath, tmpFile)) {\r
+ newFile = new File(getSavePath() + mAccount.name + mFilePath);\r
+ newFile.getParentFile().mkdirs();\r
+ boolean moved = tmpFile.renameTo(newFile);\r
+ \r
+ if (moved) {\r
+ ContentValues cv = new ContentValues();\r
+ cv.put(ProviderTableMeta.FILE_STORAGE_PATH, newFile.getAbsolutePath());\r
+ getContentResolver().update(\r