@@ -43,8 +43,8 @@ public class FileController {
|
|||||||
FileEntity fileEntity = fileRepository.findById(fileId)
|
FileEntity fileEntity = fileRepository.findById(fileId)
|
||||||
.orElseThrow(() -> new RuntimeException("File not found"));
|
.orElseThrow(() -> new RuntimeException("File not found"));
|
||||||
|
|
||||||
if (fileEntity.getProtectionStatus() != ProtectionStatus.NOT_PROTECTED) {
|
if (fileEntity.getProtectionStatus() == ProtectionStatus.NOT_PROTECTED) {
|
||||||
throw new RuntimeException("File is protected");
|
throw new RuntimeException("File is not protected");
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource resource = fileStorageService.loadFileAsResource(fileEntity.getProtectedFilePath());
|
Resource resource = fileStorageService.loadFileAsResource(fileEntity.getProtectedFilePath());
|
||||||
|
|||||||
Reference in New Issue
Block a user