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