Class CopyOperation
java.lang.Object
org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
org.apache.sling.servlets.post.impl.operations.CopyOperation
- All Implemented Interfaces:
JakartaPostOperation
The
CopyOperation
class implements the
copy
operation for the Sling default POST servlet.-
Field Summary
Fields inherited from class org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
jcrSupport, log
Fields inherited from interface org.apache.sling.servlets.post.JakartaPostOperation
PROP_OPERATION_NAME, SERVICE_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
doRun
(org.apache.sling.api.SlingJakartaHttpServletRequest request, JakartaPostResponse response, List<Modification> changes) Actually performs the desired operation filling progress into thechanges
list and preparing and further information in theresponse
.protected org.apache.sling.api.resource.Resource
execute
(List<Modification> changes, org.apache.sling.api.resource.Resource source, String destParent, String destName, VersioningConfiguration versioningConfiguration) Actually executes the operation.protected String
Returns a short name to be used in log and status messages.Methods inherited from class org.apache.sling.servlets.post.impl.operations.AbstractPostOperation
externalizePath, getApplyToResources, getResourcePath, getVersioningConfiguration, isSkipCheckin, orderResource, run
-
Constructor Details
-
CopyOperation
public CopyOperation()
-
-
Method Details
-
getOperationName
Returns a short name to be used in log and status messages.- Returns:
- the name of the operation
-
execute
protected org.apache.sling.api.resource.Resource execute(List<Modification> changes, org.apache.sling.api.resource.Resource source, String destParent, String destName, VersioningConfiguration versioningConfiguration) throws org.apache.sling.api.resource.PersistenceException Actually executes the operation.- Parameters:
changes
- the changes to executesource
- 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 thedestParent
. Ifnull
the name of thesource
is used as the target item name.versioningConfiguration
- the configuration for versioning- Returns:
- the resource which results of this operation
- Throws:
org.apache.sling.api.resource.PersistenceException
- May be thrown if an error occurs executing the operation.
-
doRun
protected final void doRun(org.apache.sling.api.SlingJakartaHttpServletRequest request, JakartaPostResponse response, List<Modification> changes) throws org.apache.sling.api.resource.PersistenceException Description copied from class:AbstractPostOperation
Actually performs the desired operation filling progress into thechanges
list and preparing and further information in theresponse
.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 classAbstractPostOperation
- Parameters:
request
- TheSlingJakartaHttpServletRequest
providing the input, mostly in terms of request parameters, to the operation.response
- ThePostResponse
to fill with response informationchanges
- A container to addModification
instances representing the operations done.- Throws:
org.apache.sling.api.resource.PersistenceException
- Maybe thrown if any error occurs while accessing the repository.
-