Package org.dspace.app.rest.repository
Class BundlePrimaryBitstreamLinkRepository
java.lang.Object
org.dspace.app.rest.repository.AbstractDSpaceRestRepository
org.dspace.app.rest.repository.BundlePrimaryBitstreamLinkRepository
- All Implemented Interfaces:
LinkRestRepository
@Component("core.bundles.primaryBitstream")
public class BundlePrimaryBitstreamLinkRepository
extends AbstractDSpaceRestRepository
implements LinkRestRepository
Link repository for "primaryBitstream" subresource of an individual bundle.
-
Field Summary
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePrimaryBitstream(Context context, UUID bundleId, Bitstream bitstream, Projection projection) Sets a primaryBitstream on a Bundle.voiddeletePrimaryBitstream(Context context, UUID bundleId) Deletes the primaryBitstream on a Bundle.getPrimaryBitstream(jakarta.servlet.http.HttpServletRequest request, UUID bundleId, org.springframework.data.domain.Pageable optionalPageable, Projection projection) Retrieves the primaryBitstream of a Bundle.updatePrimaryBitstream(Context context, UUID bundleId, Bitstream bitstream, Projection projection) Updates a primaryBitstream on a Bundle.Methods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.app.rest.repository.LinkRestRepository
isEmbeddableRelation
-
Constructor Details
-
BundlePrimaryBitstreamLinkRepository
public BundlePrimaryBitstreamLinkRepository()
-
-
Method Details
-
getPrimaryBitstream
@PreAuthorize("hasPermission(#bundleId, \'BUNDLE\', \'READ\')") public BitstreamRest getPrimaryBitstream(@Nullable jakarta.servlet.http.HttpServletRequest request, UUID bundleId, @Nullable org.springframework.data.domain.Pageable optionalPageable, Projection projection) Retrieves the primaryBitstream of a Bundle. Returns null if Bundle doesn't have a primaryBitstream.curl -X GET "http://{dspace.server.url}/api/core/bundles/{bundle-uuid}/primaryBitstream"- Parameters:
request- The HttpServletRequest if relevantbundleId- The UUID of the BundleoptionalPageable- The pageable if relevantprojection- The projection to use- Returns:
- The primaryBitstream, or null if not found
-
createPrimaryBitstream
@PreAuthorize("hasPermission(#bundleId, \'BUNDLE\', \'WRITE\')") public BundleRest createPrimaryBitstream(Context context, UUID bundleId, Bitstream bitstream, Projection projection) Sets a primaryBitstream on a Bundle.- Parameters:
context- The current DSpace contextbundleId- The UUID of the Bundlebitstream- The Bitstream to use as primaryBitstreamprojection- The projection to use- Returns:
- The Bundle
-
updatePrimaryBitstream
@PreAuthorize("hasPermission(#bundleId, \'BUNDLE\', \'WRITE\')") public BundleRest updatePrimaryBitstream(Context context, UUID bundleId, Bitstream bitstream, Projection projection) Updates a primaryBitstream on a Bundle.- Parameters:
context- The current DSpace contextbundleId- The UUID of the Bundlebitstream- The Bitstream to use as primaryBitstreamprojection- The projection to use- Returns:
- The Bundle
-
deletePrimaryBitstream
@PreAuthorize("hasPermission(#bundleId, \'BUNDLE\', \'WRITE\')") public void deletePrimaryBitstream(Context context, UUID bundleId) Deletes the primaryBitstream on a Bundle.- Parameters:
context- The current DSpace contextbundleId- The UUID of the Bundle
-