@DoValidation( v = {ValidateDownload.class}, to = "/hello/hello.html") @RequestMapping(value = "/download") public DoxModelAndView downloadFile(HelloForm form) throws Exception { Downloads.downloadFile(Paths.get("//LS-XHLE38/share/var/", form.getFileName())); return download(form); }
@RequestMapping(value = "/upload", method = RequestMethod.POST) public DoxModelAndView upload(HelloForm form) { try (OutputStream stream = new BufferedOutputStream( new FileOutputStream( Paths.get("//LS-XHLE38/share/var/", form.getFileName()).toFile()))) { stream.write(form.getFile().getBytes()); addMessage(new AppMessage(INFO, "completes.upload")); } catch (Exception e) { LOG.info("message = {}, stacktrace = {}", e.getMessage(), e.getStackTrace()); } return view("/hello/hello.html", form); }