This commit is contained in:
@@ -286,9 +286,6 @@ public class ApiController {
|
||||
}
|
||||
}
|
||||
|
||||
@Value("${file.storage.base-path}")
|
||||
private String baseStoragePath;
|
||||
|
||||
@GetMapping("/v{version}/files/download/{fileId}")
|
||||
public ResponseEntity<?> downloadFile(
|
||||
@PathVariable(required = false) String fileId,
|
||||
@@ -340,9 +337,8 @@ public class ApiController {
|
||||
errorData));
|
||||
}
|
||||
|
||||
// String fullPath = baseStoragePath + "/" + entityResponse.getProtectStatus();
|
||||
// Path filePath = Paths.get(entityResponse.getProtectStatus());
|
||||
Path filePath = Paths.get(entityResponse.getProtectStatus());
|
||||
|
||||
Path filePath = Paths.get(entityResponse.getProtectedFilePath());
|
||||
Resource resource = new UrlResource(filePath.toUri());
|
||||
|
||||
if (!resource.exists()) {
|
||||
|
||||
@@ -19,6 +19,7 @@ public class FileEntityResponse {
|
||||
private String originalFileName;
|
||||
private String storedFileName;
|
||||
private String filePath;
|
||||
private String protectedFilePath;
|
||||
private Long fileSize;
|
||||
private String mimeType;
|
||||
private String fileExtension;
|
||||
|
||||
@@ -383,6 +383,7 @@ public class FileEntityService {
|
||||
//TODO fix after add logic for check for protect file
|
||||
.checksCount(0)
|
||||
.fileUploadDate(fileEntity.getCreatedAt())
|
||||
.protectedFilePath(fileEntity.getProtectedFilePath())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user