Package org.alfresco.repo.webdav
Class PutMethod
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAVMethod
-
- org.alfresco.repo.webdav.PutMethod
-
- All Implemented Interfaces:
ActivityPostProducer
- Direct Known Subclasses:
PostMethod
public class PutMethod extends WebDAVMethod implements ActivityPostProducer
Implements the WebDAV PUT method- Author:
- Gavin Cornwell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.webdav.WebDAVMethod
WebDAVMethod.Condition
-
-
Field Summary
-
Fields inherited from class org.alfresco.repo.webdav.WebDAVMethod
logger, m_childToParent, m_conditions, m_davHelper, m_depth, m_parentLockInfo, m_request, m_resourceTag, m_response, m_rootNodeRef, m_strPath, m_userAgent
-
-
Constructor Summary
Constructors Constructor Description PutMethod()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecuteImpl()Execute the WebDAV requestorg.alfresco.service.cmr.model.FileInfogetContentNodeInfo()The FileInfo for the uploaded file, or null if not yet uploaded.StringgetContentType()Retrieve the mimetype of the content sent for the PUT request.longgetFileSize()Returns the size of the uploaded file, zero if not yet uploaded.protected booleanisCreated()Can be used after a successfulWebDAVMethod.execute()invocation to check whether the resource was new (created) or over-writing existing content.protected voidparseRequestBody()Clears the aspect added by a LOCK request for a new file, so that the Timer started by the LOCK request will not remove the node now that the PUT request has been received.protected voidparseRequestHeaders()Parse the request headersprotected voidpostActivity()Create an activity post.voidsetActivityPoster(WebDAVActivityPoster activityPoster)-
Methods inherited from class org.alfresco.repo.webdav.WebDAVMethod
checkNode, checkNode, createXMLWriter, execute, flushXML, generateLockDiscoveryXML, generateLockDiscoveryXML, generateNamespaceDeclarations, generateResponseImpl, getActionService, getAuthenticationService, getContentService, getContextPath, getDAVHelper, getDAVLockService, getDepth, getFileFolderService, getMimetypeService, getNamespaceService, getNodeForPath, getNodeLockInfo, getNodeService, getPath, getPermissionService, getRequestBodyAsDocument, getRootNodeRef, getSearchService, getServiceRegistry, getServletPath, getSiteId, getStatusForAccessDeniedException, getTenantDomain, getTransactionService, getURLForPath, getWorkingCopy, getXMLOutputFormat, isReadOnly, parseDepthHeader, parseIfHeader, setDetails, shouldFlushXMLWriter, toString
-
-
-
-
Method Detail
-
parseRequestHeaders
protected void parseRequestHeaders() throws WebDAVServerExceptionParse the request headers- Specified by:
parseRequestHeadersin classWebDAVMethod- Throws:
WebDAVServerException
-
parseRequestBody
protected void parseRequestBody() throws WebDAVServerExceptionClears the aspect added by a LOCK request for a new file, so that the Timer started by the LOCK request will not remove the node now that the PUT request has been received. This is needed for large content.- Specified by:
parseRequestBodyin classWebDAVMethod- Throws:
WebDAVServerException
-
executeImpl
protected void executeImpl() throws WebDAVServerException, ExceptionExecute the WebDAV request- Specified by:
executeImplin classWebDAVMethod- Throws:
WebDAVServerExceptionException- any unhandled exception
-
isCreated
protected boolean isCreated()
Can be used after a successfulWebDAVMethod.execute()invocation to check whether the resource was new (created) or over-writing existing content.- Returns:
- true if the content was newly created, false if existing.
-
getContentType
public String getContentType()
Retrieve the mimetype of the content sent for the PUT request. The initial value specified in the request may be updated after the file contents have been uploaded if the repository has determined a different mimetype for the content.- Returns:
- content-type
-
getContentNodeInfo
public org.alfresco.service.cmr.model.FileInfo getContentNodeInfo()
The FileInfo for the uploaded file, or null if not yet uploaded.- Returns:
- FileInfo
-
getFileSize
public long getFileSize()
Returns the size of the uploaded file, zero if not yet uploaded.- Returns:
- the fileSize
-
postActivity
protected void postActivity() throws WebDAVServerExceptionCreate an activity post.- Throws:
WebDAVServerException
-
setActivityPoster
public void setActivityPoster(WebDAVActivityPoster activityPoster)
- Specified by:
setActivityPosterin interfaceActivityPostProducer
-
-