Advertisement
superserio

Untitled

Aug 25th, 2021
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. @EFWMExternalRestSecurity
  2. @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
  3. @ApiOperation(value = "carico File", notes = "Carico File")
  4. public @ResponseBody ResponseEntity<Object> uploadFile(@ModelAttribute MultipartFile file) {
  5.     System.out.println("- Here you are in the controller -");
  6.    
  7.     MessageResponseEntity entity = null;
  8.     ResponseEntity<Object> responseEntity = null;
  9.     try {
  10.         entity = new MessageResponseEntity();
  11.         storageService.save(file);
  12.         responseEntity = createHttp200OkResponseEntity(entity);
  13.     }  catch (final EFWMException e) {
  14.         responseEntity = createHttp200ServerErrorRsponse(entity, e);
  15.     }  catch (final Exception e) {
  16.         responseEntity = createHttp500ServerErrorRsponse(e);
  17.     }
  18.     return responseEntity;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement