mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
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:
parent
baf4d6a627
commit
679c7ed157
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue