code: @RequestMapping(value = "/get.action", method = RequestMethod.GET)
      public ResponseEntity<?> getFile(@RequestParam Integer id) {
  
          final HttpHeaders responseHeaders = new HttpHeaders();
          Map<String, Object> responseMap = new HashMap<String, Object>();
  
          try {
              File file = service.findById(id);
  
              if (file == null) {
                  throw new Exception("Could not find the file with id " + id);
              }
  
              byte[] fileBytes = file.getFile();
  
              responseHeaders.setContentType(
                  MediaType.parseMediaType(file.getFileType()));
  
              LOG.info("Successfully got the file " + file.getFileName());
  
              responseMap = ResultSet.success(file);
              return new ResponseEntity<byte[]>(
                  fileBytes, responseHeaders, HttpStatus.OK);
          } catch (Exception e) {
              LOG.error("Could not get the file: " + e.getMessage());
              responseMap = ResultSet.error("Could not get the file: " +
                  e.getMessage());
  
              responseHeaders.setContentType(MediaType.APPLICATION_JSON);
  
              return new ResponseEntity<Map<String, Object>>(
                  responseMap, responseHeaders, HttpStatus.OK);
          }
      }
docs: Gets a file from the database by the given id