Package org.drjekyll.webdav.copy
Class DoCopy
- java.lang.Object
-
- org.drjekyll.webdav.methods.Method
-
- org.drjekyll.webdav.copy.DoCopy
-
- All Implemented Interfaces:
MethodExecutor
public class DoCopy extends Method
-
-
Field Summary
-
Fields inherited from class org.drjekyll.webdav.methods.Method
BUF_SIZE, CREATION_DATE_FORMAT, DEFAULT_TIMEOUT, INFINITY, LAST_MODIFIED_DATE_FORMAT, LOCAL_DATE_FORMAT, MAX_TIMEOUT, TEMP_TIMEOUT, TEMPORARY, URL_ENCODER
-
-
Constructor Summary
Constructors Constructor Description DoCopy(WebdavStore store, ResourceLocks resourceLocks, DoDelete doDelete, boolean readOnly)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
copyResource(Transaction transaction, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Copy a resource.void
execute(Transaction transaction, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
protected static String
normalize(String path)
Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out.-
Methods inherited from class org.drjekyll.webdav.methods.Method
checkLocks, creationDateFormat, getCleanPath, getDepth, getDocumentBuilder, getETag, getLocalDateFormat, getLockIdFromIfHeader, getLockIdFromLockTokenHeader, getParentPath, getRelativePath, lastModifiedDateFormat, rewriteUrl, sendReport
-
-
-
-
Constructor Detail
-
DoCopy
public DoCopy(WebdavStore store, ResourceLocks resourceLocks, DoDelete doDelete, boolean readOnly)
-
-
Method Detail
-
execute
public void execute(Transaction transaction, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
- Throws:
IOException
-
copyResource
public boolean copyResource(Transaction transaction, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
Copy a resource.- Parameters:
transaction
- indicates that the method is within the scope of a WebDAV transactionreq
- Servlet requestresp
- Servlet response- Returns:
- true if the copy is successful
- Throws:
WebdavException
- if an error in the underlying store occursIOException
- when an error occurs while sending the responseLockFailedException
-
normalize
@Nullable protected static String normalize(String path)
Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. If the specified path attempts to go outside the boundaries of the current context (i.e. too many ".." path elements are present), returnnull
instead.- Parameters:
path
- Path to be normalized- Returns:
- normalized path
-
-