Fixed lost local copy of file when moved into a folder that is not created in the local file system yet

This commit is contained in:
David A. Velasco 2014-09-01 10:35:47 +02:00
parent baf4d6a627
commit 679c7ed157

View file

@ -718,7 +718,12 @@ public class FileDataStorageManager {
File localFile = new File(localPath);
boolean renamed = false;
if (localFile.exists()) {
renamed = localFile.renameTo(new File(defaultSavePath + targetPath));
File targetFile = new File(defaultSavePath + targetPath);
File targetFolder = targetFile.getParentFile();
if (!targetFolder.exists()) {
targetFolder.mkdirs();
}
renamed = localFile.renameTo(targetFile);
}
Log_OC.d(TAG, "Local file RENAMED : " + renamed);