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 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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Utils
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • utils

      @Autowired protected Utils utils
  • Constructor Details

    • BundleUploadBitstreamController

      public BundleUploadBitstreamController()
  • Method Details

    • 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