Advertisement
TriplePi

Untitled

Nov 27th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.     @RequestMapping(value = "/aboutunion/{year}/{name}")
  2.     public void getDocument(@PathVariable String name,
  3.                             @PathVariable String year,
  4.                             ServletResponse response) {
  5.         File image = storageService.getDocumentByNameAndLanguage(year, name);
  6.         try {
  7.             InputStream inputStream = new FileInputStream(image);
  8.             IOUtils.copy(inputStream, response.getOutputStream());
  9.             response.flushBuffer();
  10.         } catch (IOException ex) {
  11.             ex.printStackTrace();
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement