Class BundleMoveOperation

java.lang.Object
org.dspace.app.rest.repository.patch.operation.PatchOperation<Bundle>
org.dspace.app.rest.repository.patch.operation.BundleMoveOperation

@Component public class BundleMoveOperation extends PatchOperation<Bundle>
This is the implementation for Bundle move patches. This operation moves bitstreams within a bundle from one index to another. Example: curl -X PATCH http://${dspace.server.url}/api/bundles/<:id-bundle> -H " Content-Type: application/json" -d '[{ "op": "move", "path": " /_links/bitstreams/1/href", "from": "/_links/bitstreams/0/href"]'
  • Constructor Details

    • BundleMoveOperation

      public BundleMoveOperation()
  • Method Details

    • perform

      public Bundle perform(Context context, Bundle bundle, Operation operation)
      Executes the move patch operation.
      Specified by:
      perform in class PatchOperation<Bundle>
      Parameters:
      bundle - the bundle in which we want to move files around.
      operation - the move patch operation.
      context - context of patch operation
      Returns:
      the updated rest model.
      Throws:
      DSpaceBadRequestException
    • supports

      public boolean supports(Object objectToMatch, Operation operation)
      Description copied from class: PatchOperation
      Determines whether or not this Patch Operation can do this patch (Object of operation and path gets checked)
      Specified by:
      supports in class PatchOperation<Bundle>
      Parameters:
      objectToMatch - Object whose class must be instance of type object for which this PatchOperation was created
      operation - Operation of the patch, should match this type of Patch Operation
      Returns:
      True if this PatchOperation class can do the patch for this given dso type and Path