Class BitstreamRestController

java.lang.Object
org.dspace.app.rest.BitstreamRestController

@RestController @RequestMapping("/api/core/bitstreams/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}") public class BitstreamRestController extends Object
This is a specialized controller to provide access to the bitstream binary content The mapping for requested endpoint try to resolve a valid UUID, for example
 
 https://<dspace.server.url>/api/core/bitstreams/26453b4d-e513-44e8-8d5b-395f62972eff/content
 
 
Author:
Andrea Bollini (andrea.bollini at 4science.it), Tom Desair (tom dot desair at atmire dot com), Frederic Van Reet (frederic dot vanreet at atmire dot com)
  • Constructor Details

    • BitstreamRestController

      public BitstreamRestController()
  • Method Details

    • retrieve

      @PreAuthorize("#accessToken != null|| hasPermission(#uuid, \'BITSTREAM\', \'READ\')") @RequestMapping(method={GET,HEAD}, value="content") public ResponseEntity retrieve(@PathVariable UUID uuid, String accessToken, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws IOException, SQLException, AuthorizeException
      Retrieve bitstream. An access token (created by request a copy for some files, if enabled) can optionally be used for authorization instead of current user/group
      Parameters:
      uuid - bitstream ID
      accessToken - request-a-copy access token (optional)
      response - HTTP response
      request - HTTP request
      Returns:
      response entity with bitstream content
      Throws:
      IOException
      SQLException
      AuthorizeException
    • updateBitstreamFormat

      @RequestMapping(method=PUT, consumes="text/uri-list", value="format") @PreAuthorize("hasPermission(#uuid, \'BITSTREAM\',\'WRITE\')") @PostAuthorize("returnObject != null") public BitstreamResource updateBitstreamFormat(@PathVariable UUID uuid, jakarta.servlet.http.HttpServletRequest request) throws SQLException
      This method will update the bitstream format of the bitstream that corresponds to the provided bitstream uuid.
      Parameters:
      uuid - The UUID of the bitstream for which to update the bitstream format
      request - The request object
      Returns:
      The wrapped resource containing the bitstream which in turn contains the bitstream format
      Throws:
      SQLException - If something goes wrong in the database