Commit 77c5d960 by 袁伟铭

1.0.0

parent 711c10e9
......@@ -24,12 +24,20 @@ import java.io.InputStream;
public class AccessController {
@GetMapping(value = "/images/**", produces = MediaType.IMAGE_JPEG_VALUE)
public BufferedImage getImage(HttpServletRequest request) throws IOException {
try (InputStream is = new FileInputStream(request.getRequestURI())) {
return ImageIO.read(is);
}
public byte[] getImage(HttpServletRequest request) throws IOException {
FileInputStream inputStream = new FileInputStream(request.getRequestURI());
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes, 0, inputStream.available());
return bytes;
}
// @GetMapping(value = "/images/**", produces = MediaType.IMAGE_JPEG_VALUE)
// public BufferedImage getImage(HttpServletRequest request) throws IOException {
// try (InputStream is = new FileInputStream(request.getRequestURI())) {
// return ImageIO.read(is);
// }
// }
@GetMapping(value = "/file/**")
public ResponseEntity<Resource> download(HttpServletRequest request) {
String contentDisposition = ContentDisposition
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment