Package org.dspace.app.rest
Class BundleUploadBitstreamController
- java.lang.Object
-
- org.dspace.app.rest.BundleUploadBitstreamController
-
@RestController @RequestMapping("/api/core/bundles//{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}}/bitstreams") public class BundleUploadBitstreamController extends ObjectController to upload bitstreams to a certain bundle, indicated by a uuid in the request Usage: POST /api/core/bundles/{uuid}/bitstreams (with file and properties of file in request) Example:curl https://<dspace.server.url>/api/core/bundles/d3599177-0408-403b-9f8d-d300edd79edb/bitstreams -XPOST -H 'Content-Type: multipart/form-data' \ -H 'Authorization: Bearer eyJhbGciOiJI...' \ -F "file=@Downloads/test.html" \ -F 'properties={ "name": "test.html", "metadata": { "dc.description": [ { "value": "example file", "language": null, "authority": null, "confidence": -1, "place": 0 } ]}, "bundleName": "ORIGINAL" };type=application/json'
-
-
Constructor Summary
Constructors Constructor Description BundleUploadBitstreamController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>uploadBitstream(javax.servlet.http.HttpServletRequest request, UUID uuid, org.springframework.web.multipart.MultipartFile uploadfile, String properties)Method to upload a Bitstream to a Bundle with the given UUID in the URL.
-
-
-
Field Detail
-
utils
@Autowired protected Utils utils
-
-
Method Detail
-
uploadBitstream
@RequestMapping(method=POST, headers="content-type=multipart/form-data") @PreAuthorize("hasPermission(#uuid, \'BUNDLE\', \'ADD\') && hasPermission(#uuid, \'BUNDLE\', \'WRITE\')") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> uploadBitstream(javax.servlet.http.HttpServletRequest request, @PathVariable UUID uuid, @RequestParam("file") org.springframework.web.multipart.MultipartFile uploadfile, @RequestParam(value="properties",required=false) String properties)Method to upload a Bitstream to a Bundle with the given UUID in the URL. This will create a Bitstream with the file provided in the request and attach this to the Item that matches the UUID in the URL. This will only work for uploading one file, any extra files will silently be ignored- Returns:
- The created BitstreamResource
-
-