Package org.dspace.app.rest
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 ObjectThis is a specialized controller to provide access to the bitstream binary content The mapping for requested endpoint try to resolve a valid UUID, for examplehttps://<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 Summary
Constructors Constructor Description BitstreamRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntityretrieve(UUID uuid, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)BitstreamResourceupdateBitstreamFormat(UUID uuid, javax.servlet.http.HttpServletRequest request)This method will update the bitstream format of the bitstream that corresponds to the provided bitstream uuid.
-
-
-
Method Detail
-
retrieve
@PreAuthorize("hasPermission(#uuid, \'BITSTREAM\', \'READ\')") @RequestMapping(method={GET,HEAD}, value="content") public org.springframework.http.ResponseEntity retrieve(@PathVariable UUID uuid, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request) throws IOException, SQLException, org.dspace.authorize.AuthorizeException- Throws:
IOExceptionSQLExceptionorg.dspace.authorize.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, javax.servlet.http.HttpServletRequest request) throws SQLExceptionThis 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 formatrequest- 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
-
-