Class 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 Object
    Controller 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'
     
     
    • Field Detail

      • utils

        @Autowired
        protected Utils utils
    • Constructor Detail

      • BundleUploadBitstreamController

        public BundleUploadBitstreamController()
    • 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