dev check to protect
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-01-28 21:18:42 +07:00
parent a32f089989
commit 31fac0ab93
3 changed files with 32 additions and 6 deletions
@@ -401,14 +401,14 @@ public class ApiController {
public ResponseEntity<?> check(@PathVariable(required = false) String fileId,
@PathVariable(required = false) String type) {
Optional<FileEntity> optionalFileEntity = fileEntityRepository.findById(fileId);
if (!optionalFileEntity.isPresent()) {
return ResponseEntity.notFound().build();
}
FileEntity fileEntity = optionalFileEntity.get();
Path path = type.toLowerCase().equals("image") ? Paths.get(fileEntity.getFilePath()) :
Paths.get(fileEntity.getProtectedFilePath());
Path path = Paths.get(fileEntity.getProtectedFilePath());
File file = path.toFile();