Package org.dspace.app.rest
Class CollectionLogoController
java.lang.Object
org.dspace.app.rest.CollectionLogoController
@RestController
@RequestMapping("/api/core/collections/{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}}/logo")
public class CollectionLogoController
extends Object
This RestController takes care of the creation and deletion of Collection's nested objects
This class will typically receive the UUID of a Collection and it'll perform logic on its nested objects
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResponseEntity<org.springframework.hateoas.RepresentationModel<?>>createLogo(jakarta.servlet.http.HttpServletRequest request, UUID uuid, MultipartFile uploadfile) This method will add a logo to the collection.
-
Field Details
-
utils
-
-
Constructor Details
-
CollectionLogoController
public CollectionLogoController()
-
-
Method Details
-
createLogo
@PreAuthorize("hasPermission(#uuid, \'COLLECTION\', \'WRITE\')") @RequestMapping(method=POST, headers="content-type=multipart/form-data") public ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> createLogo(jakarta.servlet.http.HttpServletRequest request, @PathVariable UUID uuid, @RequestParam(value="file",required=false) MultipartFile uploadfile) throws SQLException, IOException, AuthorizeException This method will add a logo to the collection. curl -X POST http://<dspace.server.url>/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' \ -XPOST -H 'Content-Type: multipart/form-data' \ -H 'Authorization: Bearer eyJhbGciOiJI...' \ -F "file=@Downloads/test.png" Example:curl -X POST http://<dspace.server.url>/api/core/collections/1c11f3f1-ba1f-4f36-908a-3f1ea9a557eb/logo' \ -XPOST -H 'Content-Type: multipart/form-data' \ -H 'Authorization: Bearer eyJhbGciOiJI...' \ -F "file=@Downloads/test.png"- Parameters:
request- The StandardMultipartHttpServletRequest that will contain the logo in its bodyuuid- The UUID of the collection- Returns:
- The created bitstream
- Throws:
SQLException- If something goes wrongIOException- If something goes wrongAuthorizeException- If the user doesn't have the correct rights
-