Class MoveOperation

java.lang.Object
org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
org.apache.sling.servlets.post.impl.operations.MoveOperation
All Implemented Interfaces:
PostOperation

public class MoveOperation extends AbstractPostOperation
The MoveOperation class implements the move operation for the Sling default POST servlet.
  • Constructor Details

    • MoveOperation

      public MoveOperation()
  • Method Details

    • getOperationName

      protected String getOperationName()
      Returns a short name to be used in log and status messages.
      Returns:
      the name of the operation
    • execute

      protected Resource execute(List<Modification> changes, Resource source, String destParent, String destName, VersioningConfiguration versioningConfiguration) throws PersistenceException
      Actually executes the operation.
      Parameters:
      changes - the changes to execute
      source - The source item to act upon.
      destParent - The absolute path of the parent of the target item.
      destName - The name of the target item inside the destParent. If null the name of the source is used as the target item name.
      versioningConfiguration - the configuration for versioning
      Returns:
      the resource which results of this operation
      Throws:
      PersistenceException - May be thrown if an error occurs executing the operation.
    • doRun

      protected final void doRun(SlingHttpServletRequest request, PostResponse response, List<Modification> changes) throws PersistenceException
      Description copied from class: AbstractPostOperation
      Actually performs the desired operation filling progress into the changes list and preparing and further information in the response.

      The response comes prepared with the path, location and parent location set. Other properties are expected to be set by this implementation.

      Specified by:
      doRun in class AbstractPostOperation
      Parameters:
      request - The SlingHttpServletRequest providing the input, mostly in terms of request parameters, to the operation.
      response - The PostResponse to fill with response information
      changes - A container to add Modification instances representing the operations done.
      Throws:
      PersistenceException - Maybe thrown if any error occurs while accessing the repository.