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 void
executeImpl()
Execute the WebDAV requestorg.alfresco.service.cmr.model.FileInfo
getContentNodeInfo()
The FileInfo for the uploaded file, or null if not yet uploaded.String
getContentType()
Retrieve the mimetype of the content sent for the PUT request.long
getFileSize()
Returns the size of the uploaded file, zero if not yet uploaded.protected boolean
isCreated()
Can be used after a successfulWebDAVMethod.execute()
invocation to check whether the resource was new (created) or over-writing existing content.protected void
parseRequestBody()
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 void
parseRequestHeaders()
Parse the request headersprotected void
postActivity()
Create an activity post.void
setActivityPoster(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 WebDAVServerException
Parse the request headers- Specified by:
parseRequestHeaders
in classWebDAVMethod
- Throws:
WebDAVServerException
-
parseRequestBody
protected void parseRequestBody() throws WebDAVServerException
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. This is needed for large content.- Specified by:
parseRequestBody
in classWebDAVMethod
- Throws:
WebDAVServerException
-
executeImpl
protected void executeImpl() throws WebDAVServerException, Exception
Execute the WebDAV request- Specified by:
executeImpl
in classWebDAVMethod
- Throws:
WebDAVServerException
Exception
- 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 WebDAVServerException
Create an activity post.- Throws:
WebDAVServerException
-
setActivityPoster
public void setActivityPoster(WebDAVActivityPoster activityPoster)
- Specified by:
setActivityPoster
in interfaceActivityPostProducer
-
-