Package org.alfresco.repo.webdav
Class WebDAV
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAV
-
public class WebDAV extends Object
Helper class used by the WebDAV protocol handling classes- Author:
- gavinc
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WebDAV()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decodeURL(String strPath)
/** Returns a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out.static String
formatCreationDate(long ldate)
Formats the given date so that it conforms with the WebDAV creation date/time formatstatic String
formatCreationDate(Date date)
Formats the given date so that it conforms with the WebDAV creation date/time formatstatic String
formatHeaderDate(long ldate)
Formats the given date for use in the HTTP headerstatic String
formatHeaderDate(Date date)
Formats the given date for use in the HTTP headerstatic String
formatModifiedDate(long ldate)
Formats the given date so that it conforms with the Last-Modified HTTP headerstatic String
formatModifiedDate(Date date)
Formats the given date so that it conforms with the Last-Modified HTTP headerstatic Object
getDAVPropertyValue(Map<org.alfresco.service.namespace.QName,Serializable> props, String davPropName)
Return the Alfresco property value for the specified WebDAV propertystatic String
getDepthName(int depth)
Returns string representation of the depthstatic String
makeLockToken(NodeRef lockNode, String owner)
Make a unique lock tokenstatic String[]
parseLockToken(String lockToken)
Parse a lock token returning the node if and username
-
-
-
Field Detail
-
DAV_NS
public static final String DAV_NS
- See Also:
- Constant Field Values
-
DAV_NS_PREFIX
public static final String DAV_NS_PREFIX
- See Also:
- Constant Field Values
-
DEPTH_0
public static final int DEPTH_0
- See Also:
- Constant Field Values
-
DEPTH_1
public static final int DEPTH_1
- See Also:
- Constant Field Values
-
DEPTH_INFINITY
public static final int DEPTH_INFINITY
- See Also:
- Constant Field Values
-
TIMEOUT_INFINITY
public static final short TIMEOUT_INFINITY
- See Also:
- Constant Field Values
-
TIMEOUT_24_HOURS
public static final int TIMEOUT_24_HOURS
- See Also:
- Constant Field Values
-
WEBDAV_SC_MULTI_STATUS
public static final int WEBDAV_SC_MULTI_STATUS
- See Also:
- Constant Field Values
-
WEBDAV_SC_LOCKED
public static final int WEBDAV_SC_LOCKED
- See Also:
- Constant Field Values
-
WEBDAV_SC_FAILED_DEPENDENCY
public static final int WEBDAV_SC_FAILED_DEPENDENCY
- See Also:
- Constant Field Values
-
WEBDAV_SC_FAILED_DEPENDENCY_DESC
public static final String WEBDAV_SC_FAILED_DEPENDENCY_DESC
- See Also:
- Constant Field Values
-
SC_OK_DESC
public static final String SC_OK_DESC
- See Also:
- Constant Field Values
-
SC_NOT_FOUND_DESC
public static final String SC_NOT_FOUND_DESC
- See Also:
- Constant Field Values
-
SC_FORBIDDEN_DESC
public static final String SC_FORBIDDEN_DESC
- See Also:
- Constant Field Values
-
METHOD_PUT
public static final String METHOD_PUT
- See Also:
- Constant Field Values
-
METHOD_POST
public static final String METHOD_POST
- See Also:
- Constant Field Values
-
METHOD_GET
public static final String METHOD_GET
- See Also:
- Constant Field Values
-
METHOD_DELETE
public static final String METHOD_DELETE
- See Also:
- Constant Field Values
-
METHOD_HEAD
public static final String METHOD_HEAD
- See Also:
- Constant Field Values
-
METHOD_OPTIONS
public static final String METHOD_OPTIONS
- See Also:
- Constant Field Values
-
METHOD_PROPFIND
public static final String METHOD_PROPFIND
- See Also:
- Constant Field Values
-
METHOD_PROPPATCH
public static final String METHOD_PROPPATCH
- See Also:
- Constant Field Values
-
METHOD_MKCOL
public static final String METHOD_MKCOL
- See Also:
- Constant Field Values
-
METHOD_MOVE
public static final String METHOD_MOVE
- See Also:
- Constant Field Values
-
METHOD_COPY
public static final String METHOD_COPY
- See Also:
- Constant Field Values
-
METHOD_LOCK
public static final String METHOD_LOCK
- See Also:
- Constant Field Values
-
METHOD_UNLOCK
public static final String METHOD_UNLOCK
- See Also:
- Constant Field Values
-
HEADER_CONTENT_LENGTH
public static final String HEADER_CONTENT_LENGTH
- See Also:
- Constant Field Values
-
HEADER_CONTENT_TYPE
public static final String HEADER_CONTENT_TYPE
- See Also:
- Constant Field Values
-
HEADER_DEPTH
public static final String HEADER_DEPTH
- See Also:
- Constant Field Values
-
HEADER_DESTINATION
public static final String HEADER_DESTINATION
- See Also:
- Constant Field Values
-
HEADER_ETAG
public static final String HEADER_ETAG
- See Also:
- Constant Field Values
-
HEADER_EXPECT
public static final String HEADER_EXPECT
- See Also:
- Constant Field Values
-
HEADER_EXPECT_CONTENT
public static final String HEADER_EXPECT_CONTENT
- See Also:
- Constant Field Values
-
HEADER_IF
public static final String HEADER_IF
- See Also:
- Constant Field Values
-
HEADER_IF_MATCH
public static final String HEADER_IF_MATCH
- See Also:
- Constant Field Values
-
HEADER_IF_MODIFIED_SINCE
public static final String HEADER_IF_MODIFIED_SINCE
- See Also:
- Constant Field Values
-
HEADER_IF_NONE_MATCH
public static final String HEADER_IF_NONE_MATCH
- See Also:
- Constant Field Values
-
HEADER_IF_RANGE
public static final String HEADER_IF_RANGE
- See Also:
- Constant Field Values
-
HEADER_IF_UNMODIFIED_SINCE
public static final String HEADER_IF_UNMODIFIED_SINCE
- See Also:
- Constant Field Values
-
HEADER_LAST_MODIFIED
public static final String HEADER_LAST_MODIFIED
- See Also:
- Constant Field Values
-
HEADER_LOCK_TOKEN
public static final String HEADER_LOCK_TOKEN
- See Also:
- Constant Field Values
-
HEADER_OVERWRITE
public static final String HEADER_OVERWRITE
- See Also:
- Constant Field Values
-
HEADER_RANGE
public static final String HEADER_RANGE
- See Also:
- Constant Field Values
-
HEADER_TIMEOUT
public static final String HEADER_TIMEOUT
- See Also:
- Constant Field Values
-
HEADER_USER_AGENT
public static final String HEADER_USER_AGENT
- See Also:
- Constant Field Values
-
HEADER_IF_DATE_FORMAT
public static final String HEADER_IF_DATE_FORMAT
- See Also:
- Constant Field Values
-
HEADER_KEY_NOT
public static final String HEADER_KEY_NOT
- See Also:
- Constant Field Values
-
AGENT_MICROSOFT_DATA_ACCESS_INTERNET_PUBLISHING_PROVIDER_DAV
public static final String AGENT_MICROSOFT_DATA_ACCESS_INTERNET_PUBLISHING_PROVIDER_DAV
- See Also:
- Constant Field Values
-
AGENT_INTERNET_EXPLORER
public static final String AGENT_INTERNET_EXPLORER
- See Also:
- Constant Field Values
-
ASTERISK
public static final String ASTERISK
- See Also:
- Constant Field Values
-
DEFAULT_NAMESPACE_URI
public static final String DEFAULT_NAMESPACE_URI
- See Also:
- Constant Field Values
-
FAKE_TOKEN
public static final String FAKE_TOKEN
- See Also:
- Constant Field Values
-
HTTP1_1
public static final String HTTP1_1
- See Also:
- Constant Field Values
-
INFINITE
public static final String INFINITE
- See Also:
- Constant Field Values
-
INFINITY
public static final String INFINITY
- See Also:
- Constant Field Values
-
OPAQUE_LOCK_TOKEN
public static final String OPAQUE_LOCK_TOKEN
- See Also:
- Constant Field Values
-
NAMESPACE_SEPARATOR
public static final String NAMESPACE_SEPARATOR
- See Also:
- Constant Field Values
-
SECOND
public static final String SECOND
- See Also:
- Constant Field Values
-
HEADER_VALUE_SEPARATOR
public static final String HEADER_VALUE_SEPARATOR
- See Also:
- Constant Field Values
-
ZERO
public static final String ZERO
- See Also:
- Constant Field Values
-
ONE
public static final String ONE
- See Also:
- Constant Field Values
-
F
public static final String F
- See Also:
- Constant Field Values
-
XML_NS
public static final String XML_NS
- See Also:
- Constant Field Values
-
XML_ACTIVE_LOCK
public static final String XML_ACTIVE_LOCK
- See Also:
- Constant Field Values
-
XML_ALLPROP
public static final String XML_ALLPROP
- See Also:
- Constant Field Values
-
XML_COLLECTION
public static final String XML_COLLECTION
- See Also:
- Constant Field Values
-
XML_CREATION_DATE
public static final String XML_CREATION_DATE
- See Also:
- Constant Field Values
-
XML_DEPTH
public static final String XML_DEPTH
- See Also:
- Constant Field Values
-
XML_DISPLAYNAME
public static final String XML_DISPLAYNAME
- See Also:
- Constant Field Values
-
XML_EXCLUSIVE
public static final String XML_EXCLUSIVE
- See Also:
- Constant Field Values
-
XML_GET_CONTENT_LANGUAGE
public static final String XML_GET_CONTENT_LANGUAGE
- See Also:
- Constant Field Values
-
XML_GET_CONTENT_LENGTH
public static final String XML_GET_CONTENT_LENGTH
- See Also:
- Constant Field Values
-
XML_GET_CONTENT_TYPE
public static final String XML_GET_CONTENT_TYPE
- See Also:
- Constant Field Values
-
XML_GET_ETAG
public static final String XML_GET_ETAG
- See Also:
- Constant Field Values
-
XML_GET_LAST_MODIFIED
public static final String XML_GET_LAST_MODIFIED
- See Also:
- Constant Field Values
-
XML_HREF
public static final String XML_HREF
- See Also:
- Constant Field Values
-
XML_LOCK_DISCOVERY
public static final String XML_LOCK_DISCOVERY
- See Also:
- Constant Field Values
-
XML_LOCK_ENTRY
public static final String XML_LOCK_ENTRY
- See Also:
- Constant Field Values
-
XML_LOCK_SCOPE
public static final String XML_LOCK_SCOPE
- See Also:
- Constant Field Values
-
XML_LOCK_TOKEN
public static final String XML_LOCK_TOKEN
- See Also:
- Constant Field Values
-
XML_LOCK_TYPE
public static final String XML_LOCK_TYPE
- See Also:
- Constant Field Values
-
XML_MULTI_STATUS
public static final String XML_MULTI_STATUS
- See Also:
- Constant Field Values
-
XML_OWNER
public static final String XML_OWNER
- See Also:
- Constant Field Values
-
XML_PROP
public static final String XML_PROP
- See Also:
- Constant Field Values
-
XML_PROPNAME
public static final String XML_PROPNAME
- See Also:
- Constant Field Values
-
XML_PROPSTAT
public static final String XML_PROPSTAT
- See Also:
- Constant Field Values
-
XML_RESOURCE_TYPE
public static final String XML_RESOURCE_TYPE
- See Also:
- Constant Field Values
-
XML_RESPONSE
public static final String XML_RESPONSE
- See Also:
- Constant Field Values
-
XML_SHARED
public static final String XML_SHARED
- See Also:
- Constant Field Values
-
XML_SOURCE
public static final String XML_SOURCE
- See Also:
- Constant Field Values
-
XML_STATUS
public static final String XML_STATUS
- See Also:
- Constant Field Values
-
XML_SUPPORTED_LOCK
public static final String XML_SUPPORTED_LOCK
- See Also:
- Constant Field Values
-
XML_TIMEOUT
public static final String XML_TIMEOUT
- See Also:
- Constant Field Values
-
XML_WRITE
public static final String XML_WRITE
- See Also:
- Constant Field Values
-
XML_SET
public static final String XML_SET
- See Also:
- Constant Field Values
-
XML_REMOVE
public static final String XML_REMOVE
- See Also:
- Constant Field Values
-
XML_ERROR
public static final String XML_ERROR
- See Also:
- Constant Field Values
-
XML_NS_ACTIVE_LOCK
public static final String XML_NS_ACTIVE_LOCK
- See Also:
- Constant Field Values
-
XML_NS_ALLPROP
public static final String XML_NS_ALLPROP
- See Also:
- Constant Field Values
-
XML_NS_COLLECTION
public static final String XML_NS_COLLECTION
- See Also:
- Constant Field Values
-
XML_NS_CREATION_DATE
public static final String XML_NS_CREATION_DATE
- See Also:
- Constant Field Values
-
XML_NS_DEPTH
public static final String XML_NS_DEPTH
- See Also:
- Constant Field Values
-
XML_NS_DISPLAYNAME
public static final String XML_NS_DISPLAYNAME
- See Also:
- Constant Field Values
-
XML_NS_EXCLUSIVE
public static final String XML_NS_EXCLUSIVE
- See Also:
- Constant Field Values
-
XML_NS_GET_CONTENT_LANGUAGE
public static final String XML_NS_GET_CONTENT_LANGUAGE
- See Also:
- Constant Field Values
-
XML_NS_GET_CONTENT_LENGTH
public static final String XML_NS_GET_CONTENT_LENGTH
- See Also:
- Constant Field Values
-
XML_NS_GET_CONTENT_TYPE
public static final String XML_NS_GET_CONTENT_TYPE
- See Also:
- Constant Field Values
-
XML_NS_GET_ETAG
public static final String XML_NS_GET_ETAG
- See Also:
- Constant Field Values
-
XML_NS_GET_LAST_MODIFIED
public static final String XML_NS_GET_LAST_MODIFIED
- See Also:
- Constant Field Values
-
XML_NS_HREF
public static final String XML_NS_HREF
- See Also:
- Constant Field Values
-
XML_NS_LOCK_DISCOVERY
public static final String XML_NS_LOCK_DISCOVERY
- See Also:
- Constant Field Values
-
XML_NS_LOCK_ENTRY
public static final String XML_NS_LOCK_ENTRY
- See Also:
- Constant Field Values
-
XML_NS_LOCK_SCOPE
public static final String XML_NS_LOCK_SCOPE
- See Also:
- Constant Field Values
-
XML_NS_LOCK_TOKEN
public static final String XML_NS_LOCK_TOKEN
- See Also:
- Constant Field Values
-
XML_NS_LOCK_TYPE
public static final String XML_NS_LOCK_TYPE
- See Also:
- Constant Field Values
-
XML_NS_MULTI_STATUS
public static final String XML_NS_MULTI_STATUS
- See Also:
- Constant Field Values
-
XML_NS_OWNER
public static final String XML_NS_OWNER
- See Also:
- Constant Field Values
-
XML_NS_PROP
public static final String XML_NS_PROP
- See Also:
- Constant Field Values
-
XML_NS_PROPNAME
public static final String XML_NS_PROPNAME
- See Also:
- Constant Field Values
-
XML_NS_PROPSTAT
public static final String XML_NS_PROPSTAT
- See Also:
- Constant Field Values
-
XML_NS_RESOURCE_TYPE
public static final String XML_NS_RESOURCE_TYPE
- See Also:
- Constant Field Values
-
XML_NS_RESPONSE
public static final String XML_NS_RESPONSE
- See Also:
- Constant Field Values
-
XML_NS_SHARED
public static final String XML_NS_SHARED
- See Also:
- Constant Field Values
-
XML_NS_SOURCE
public static final String XML_NS_SOURCE
- See Also:
- Constant Field Values
-
XML_NS_STATUS
public static final String XML_NS_STATUS
- See Also:
- Constant Field Values
-
XML_NS_SUPPORTED_LOCK
public static final String XML_NS_SUPPORTED_LOCK
- See Also:
- Constant Field Values
-
XML_NS_TIMEOUT
public static final String XML_NS_TIMEOUT
- See Also:
- Constant Field Values
-
XML_NS_WRITE
public static final String XML_NS_WRITE
- See Also:
- Constant Field Values
-
XML_NS_ERROR
public static final String XML_NS_ERROR
- See Also:
- Constant Field Values
-
XML_NS_CANNOT_MODIFY_PROTECTED_PROPERTY
public static final String XML_NS_CANNOT_MODIFY_PROTECTED_PROPERTY
- See Also:
- Constant Field Values
-
XML_CONTENT_TYPE
public static final String XML_CONTENT_TYPE
- See Also:
- Constant Field Values
-
XML_ALF_AUTHTICKET
public static final String XML_ALF_AUTHTICKET
- See Also:
- Constant Field Values
-
XML_NS_ALF_AUTHTICKET
public static final String XML_NS_ALF_AUTHTICKET
- See Also:
- Constant Field Values
-
PathSeperator
public static final String PathSeperator
- See Also:
- Constant Field Values
-
PathSeperatorChar
public static final char PathSeperatorChar
- See Also:
- Constant Field Values
-
LOCK_TOKEN_SEPERATOR
public static final String LOCK_TOKEN_SEPERATOR
- See Also:
- Constant Field Values
-
RootPath
public static final String RootPath
- See Also:
- Constant Field Values
-
-
Method Detail
-
formatModifiedDate
public static String formatModifiedDate(Date date)
Formats the given date so that it conforms with the Last-Modified HTTP header- Parameters:
date
- The date to format- Returns:
- The formatted date string
-
formatModifiedDate
public static String formatModifiedDate(long ldate)
Formats the given date so that it conforms with the Last-Modified HTTP header- Parameters:
ldate
- long- Returns:
- The formatted date string
-
formatCreationDate
public static String formatCreationDate(Date date)
Formats the given date so that it conforms with the WebDAV creation date/time format- Parameters:
date
- The date to format- Returns:
- The formatted date string
-
formatCreationDate
public static String formatCreationDate(long ldate)
Formats the given date so that it conforms with the WebDAV creation date/time format- Parameters:
ldate
- long- Returns:
- The formatted date string
-
formatHeaderDate
public static String formatHeaderDate(Date date)
Formats the given date for use in the HTTP header- Parameters:
date
- Date- Returns:
- String
-
formatHeaderDate
public static String formatHeaderDate(long ldate)
Formats the given date for use in the HTTP header- Parameters:
ldate
- long- Returns:
- String
-
getDAVPropertyValue
public static Object getDAVPropertyValue(Map<org.alfresco.service.namespace.QName,Serializable> props, String davPropName)
Return the Alfresco property value for the specified WebDAV property- Parameters:
davPropName
- String- Returns:
- Object
-
decodeURL
public static String decodeURL(String strPath)
/** Returns 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:
strPath
- The path to be decoded
-
makeLockToken
public static final String makeLockToken(NodeRef lockNode, String owner)
Make a unique lock token- Parameters:
lockNode
- NodeRefowner
- String- Returns:
- String
-
parseLockToken
public static final String[] parseLockToken(String lockToken)
Parse a lock token returning the node if and username- Parameters:
lockToken
- String- Returns:
- String[]
-
getDepthName
public static final String getDepthName(int depth)
Returns string representation of the depth- Parameters:
depth
- int- Returns:
- String
-
-