Skip to content

Commit

Permalink
add getFileNameBasedOnEncryptionStatus
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jan 7, 2025
1 parent d087bdc commit adc4b86
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ public void addRenameFileOfflineOperation(OCFile file, String newName) {
offlineOperationDao.insert(entity);
}

public String getFileNameBasedOnEncryptionStatus(OCFile file) {
FileEntity entity = fileDao.getFileById(file.getFileId());
if (entity == null) {
return file.getFileName();
}

if (file.isEncrypted()) {
return entity.getEncryptedName();
} else {
return entity.getName();
}
}

public String getFilenameConsideringOfflineOperation(OCFile file) {
String filename = file.getDecryptedFileName();
OfflineOperationEntity renameEntity = offlineOperationDao.getByPath(file.getDecryptedRemotePath());
Expand Down

0 comments on commit adc4b86

Please sign in to comment.