|
|
@@ -38,10 +38,11 @@ public class FileDownloadController { |
|
|
|
@GetMapping("/fs/files/**") |
|
|
|
public ResponseEntity<InputStreamResource> files(@RequestParam(value = "name", required = false) String name, |
|
|
|
@RequestParam(value = "noCache", required = false) Boolean noCache, |
|
|
|
@RequestParam(value = "absolutePath", required = false) Boolean absolutePath, |
|
|
|
HttpServletRequest request |
|
|
|
) throws FileNotFoundException { |
|
|
|
String filePath = request.getRequestURI().substring(10); |
|
|
|
return download(filePath, name, noCache, request); |
|
|
|
return download(filePath, name, noCache,absolutePath, request); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -51,9 +52,10 @@ public class FileDownloadController { |
|
|
|
public ResponseEntity<InputStreamResource> download(@RequestParam(value = "path") String path, |
|
|
|
@RequestParam(value = "name", required = false) String name, |
|
|
|
@RequestParam(value = "noCache", required = false) Boolean noCache, |
|
|
|
@RequestParam(value = "absolutePath", required = false) Boolean absolutePath, |
|
|
|
HttpServletRequest request |
|
|
|
) throws FileNotFoundException { |
|
|
|
File file = new File(filePathGenerator.getFileDiskPath(path)); |
|
|
|
File file = new File(absolutePath? path:filePathGenerator.getFileDiskPath(path)); |
|
|
|
|
|
|
|
if (!file.exists()) { |
|
|
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).build(); |
|
|
|