|
@@ -553,6 +553,7 @@ public class RefreshFolderOperation extends RemoteOperation {
|
|
updatedFiles.add(updatedFile);
|
|
updatedFiles.add(updatedFile);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// save updated contents in local database
|
|
// save updated contents in local database
|
|
// update file name for encrypted files
|
|
// update file name for encrypted files
|
|
if (e2EVersion == E2EVersion.V1_2) {
|
|
if (e2EVersion == E2EVersion.V1_2) {
|
|
@@ -636,20 +637,35 @@ public class RefreshFolderOperation extends RemoteOperation {
|
|
mimetype = MimeType.DIRECTORY;
|
|
mimetype = MimeType.DIRECTORY;
|
|
} else {
|
|
} else {
|
|
DecryptedFile decryptedFile = metadata.getMetadata().getFiles().get(updatedFile.getFileName());
|
|
DecryptedFile decryptedFile = metadata.getMetadata().getFiles().get(updatedFile.getFileName());
|
|
|
|
+
|
|
|
|
+ if (decryptedFile == null) {
|
|
|
|
+ throw new NullPointerException("decryptedFile cannot be null");
|
|
|
|
+ }
|
|
|
|
+
|
|
decryptedFileName = decryptedFile.getFilename();
|
|
decryptedFileName = decryptedFile.getFilename();
|
|
mimetype = decryptedFile.getMimetype();
|
|
mimetype = decryptedFile.getMimetype();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
OCFile parentFile = storageManager.getFileById(updatedFile.getParentId());
|
|
OCFile parentFile = storageManager.getFileById(updatedFile.getParentId());
|
|
- String decryptedRemotePath = parentFile.getDecryptedRemotePath() + decryptedFileName;
|
|
|
|
|
|
+
|
|
|
|
+ if (parentFile == null) {
|
|
|
|
+ throw new NullPointerException("parentFile cannot be null");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String decryptedRemotePath;
|
|
|
|
+ if (decryptedFileName != null) {
|
|
|
|
+ decryptedRemotePath = parentFile.getDecryptedRemotePath() + decryptedFileName;
|
|
|
|
+ } else {
|
|
|
|
+ decryptedRemotePath = parentFile.getRemotePath() + updatedFile.getFileName();
|
|
|
|
+ }
|
|
|
|
|
|
if (updatedFile.isFolder()) {
|
|
if (updatedFile.isFolder()) {
|
|
decryptedRemotePath += "/";
|
|
decryptedRemotePath += "/";
|
|
}
|
|
}
|
|
updatedFile.setDecryptedRemotePath(decryptedRemotePath);
|
|
updatedFile.setDecryptedRemotePath(decryptedRemotePath);
|
|
|
|
|
|
- if (mimetype == null || mimetype.isEmpty()) {
|
|
|
|
|
|
+ if (mimetype.isEmpty()) {
|
|
if (updatedFile.isFolder()) {
|
|
if (updatedFile.isFolder()) {
|
|
updatedFile.setMimeType(MimeType.DIRECTORY);
|
|
updatedFile.setMimeType(MimeType.DIRECTORY);
|
|
} else {
|
|
} else {
|