public class WebDAVHelper
extends java.lang.Object
Provides helper methods for repository access using the WebDAV protocol.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EMPTY_SITE_ID |
static java.lang.String |
PathSeperator |
static char |
PathSeperatorChar |
| Modifier | Constructor and Description |
|---|---|
protected |
WebDAVHelper(java.lang.String urlPathPrefix,
org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.security.AuthenticationService authService,
org.alfresco.repo.tenant.TenantService tenantService)
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkDestinationURL(javax.servlet.http.HttpServletRequest request,
java.lang.String urlStr)
Check that the destination path is on this server and is a valid WebDAV
path for this server
|
static java.lang.String |
decodeURL(java.lang.String s) |
java.lang.String |
determineSiteId(WebDAVMethod method) |
java.lang.String |
determineTenantDomain(WebDAVMethod method) |
static java.lang.String |
encodeHTML(java.lang.String string)
Encodes the given string to valid HTML format
|
static java.lang.String |
encodeURL(java.lang.String s)
Encodes the given string to valid URL format
|
static java.lang.String |
encodeURL(java.lang.String s,
java.lang.String userAgent) |
static java.lang.String |
encodeUrlReservedSymbols(java.lang.String string)
ALF-5333: Microsoft clients use ISO-8859-1 to decode WebDAV responses
so this method should only be used for Microsoft user agents.
|
org.alfresco.service.cmr.action.ActionService |
getActionService() |
org.alfresco.service.cmr.security.AuthenticationService |
getAuthenticationService() |
java.util.List |
getChildren(org.alfresco.service.cmr.model.FileInfo fileInfo) |
org.alfresco.service.cmr.repository.CopyService |
getCopyService() |
java.lang.String |
getDestinationPath(java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String destURL)
Extract the destination path for MOVE or COPY commands from the
supplied destination URL header.
|
org.alfresco.service.cmr.dictionary.DictionaryService |
getDictionaryService() |
org.alfresco.service.cmr.model.FileFolderService |
getFileFolderService() |
WebDAVLockService |
getLockService() |
org.alfresco.service.cmr.repository.MimetypeService |
getMimetypeService() |
org.alfresco.service.namespace.NamespaceService |
getNamespaceService() |
org.alfresco.service.cmr.model.FileInfo |
getNodeForPath(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String path,
java.lang.String servletPath)
Get the file info for the given paths
|
org.alfresco.service.cmr.repository.NodeService |
getNodeService() |
org.xml.sax.helpers.AttributesImpl |
getNullAttributes() |
org.alfresco.service.cmr.model.FileInfo |
getParentNodeForPath(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String path,
java.lang.String servletPath) |
java.lang.String |
getPathFromNode(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Return the relative path for the node walking back to the specified root node
|
org.alfresco.service.cmr.security.PermissionService |
getPermissionService() |
java.lang.String |
getRepositoryPath(javax.servlet.http.HttpServletRequest request) |
org.alfresco.service.cmr.search.SearchService |
getSearchService() |
org.alfresco.service.ServiceRegistry |
getServiceRegistry() |
org.alfresco.repo.tenant.TenantService |
getTenantService()
Retrieve the
TenantService held by the helper. |
java.lang.String |
getURLForPath(javax.servlet.http.HttpServletRequest request,
java.lang.String path,
boolean isCollection) |
java.lang.String |
getURLForPath(javax.servlet.http.HttpServletRequest request,
java.lang.String path,
boolean isCollection,
java.lang.String userAgent) |
java.lang.String |
getUrlPathPrefix(javax.servlet.http.HttpServletRequest request) |
boolean |
isLockedOrReadOnly(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates if the node is unlocked or the current user has a WRITE_LOCK
|
java.lang.String |
makeETag(org.alfresco.service.cmr.model.FileInfo nodeInfo)
Make an ETag value for a node using the GUID and modify date/time
|
protected void |
makeETagString(org.alfresco.service.cmr.model.FileInfo nodeInfo,
java.lang.StringBuilder etag)
Make an ETag value for a node using the GUID and modify date/time
|
java.lang.String |
makeQuotedETag(org.alfresco.service.cmr.model.FileInfo nodeInfo)
Make an ETag value for a node using the GUID and modify date/time
|
void |
setUrlPathPrefix(java.lang.String urlPathPrefix) |
java.util.List |
splitAllPaths(java.lang.String path)
Split the path into all the component directories and filename
|
java.lang.String[] |
splitPath(java.lang.String path)
Split the path into seperate directory path and file name strings.
|
public static final java.lang.String PathSeperator
public static final char PathSeperatorChar
public static final java.lang.String EMPTY_SITE_ID
protected WebDAVHelper(java.lang.String urlPathPrefix,
org.alfresco.service.ServiceRegistry serviceRegistry,
org.alfresco.service.cmr.security.AuthenticationService authService,
org.alfresco.repo.tenant.TenantService tenantService)
public final org.alfresco.service.cmr.security.AuthenticationService getAuthenticationService()
public final org.alfresco.service.ServiceRegistry getServiceRegistry()
public final org.alfresco.service.cmr.repository.NodeService getNodeService()
public org.alfresco.service.cmr.model.FileFolderService getFileFolderService()
public final org.alfresco.service.cmr.search.SearchService getSearchService()
public final org.alfresco.service.namespace.NamespaceService getNamespaceService()
public final org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
public final org.alfresco.service.cmr.repository.MimetypeService getMimetypeService()
public final WebDAVLockService getLockService()
public final org.alfresco.service.cmr.action.ActionService getActionService()
public final org.alfresco.service.cmr.security.PermissionService getPermissionService()
public org.alfresco.repo.tenant.TenantService getTenantService()
TenantService held by the helper.public final org.alfresco.service.cmr.repository.CopyService getCopyService()
public final java.lang.String[] splitPath(java.lang.String path)
path - Full path string.public final java.util.List splitAllPaths(java.lang.String path)
path - the string to splitpublic java.lang.String getURLForPath(javax.servlet.http.HttpServletRequest request,
java.lang.String path,
boolean isCollection)
public java.lang.String getURLForPath(javax.servlet.http.HttpServletRequest request,
java.lang.String path,
boolean isCollection,
java.lang.String userAgent)
public final org.alfresco.service.cmr.model.FileInfo getNodeForPath(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String path,
java.lang.String servletPath)
throws org.alfresco.service.cmr.model.FileNotFoundException
rootNodeRef - the acting webdav rootpath - the path to search forservletPath - the base servlet path, which may be null or emptyorg.alfresco.service.cmr.model.FileNotFoundException - if the path doesn't refer to a valid nodepublic final org.alfresco.service.cmr.model.FileInfo getParentNodeForPath(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String path,
java.lang.String servletPath)
throws org.alfresco.service.cmr.model.FileNotFoundException
org.alfresco.service.cmr.model.FileNotFoundExceptionpublic final java.lang.String getPathFromNode(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
throws org.alfresco.service.cmr.model.FileNotFoundException
rootNodeRef - the root below which the path will be validnodeRef - the node's path to getorg.alfresco.service.cmr.model.FileNotFoundExceptionpublic java.util.List getChildren(org.alfresco.service.cmr.model.FileInfo fileInfo)
throws WebDAVServerException
WebDAVServerExceptionpublic final java.lang.String makeETag(org.alfresco.service.cmr.model.FileInfo nodeInfo)
public final java.lang.String makeQuotedETag(org.alfresco.service.cmr.model.FileInfo nodeInfo)
protected final void makeETagString(org.alfresco.service.cmr.model.FileInfo nodeInfo,
java.lang.StringBuilder etag)
public final org.xml.sax.helpers.AttributesImpl getNullAttributes()
public static final java.lang.String encodeURL(java.lang.String s)
s - the String to convertpublic static final java.lang.String encodeURL(java.lang.String s,
java.lang.String userAgent)
public static final java.lang.String decodeURL(java.lang.String s)
public static final java.lang.String encodeHTML(java.lang.String string)
string - the String to convertpublic static final java.lang.String encodeUrlReservedSymbols(java.lang.String string)
throws java.io.UnsupportedEncodingException
string - java.io.UnsupportedEncodingExceptionpublic java.lang.String determineSiteId(WebDAVMethod method)
public java.lang.String determineTenantDomain(WebDAVMethod method)
public java.lang.String getDestinationPath(java.lang.String contextPath,
java.lang.String servletPath,
java.lang.String destURL)
servletPath - Path prefix of the WebDAV servlet.destURL - The Destination header.public void checkDestinationURL(javax.servlet.http.HttpServletRequest request,
java.lang.String urlStr)
throws WebDAVServerException
request - The request made against the WebDAV server.urlStr - StringWebDAVServerExceptionpublic void setUrlPathPrefix(java.lang.String urlPathPrefix)
public java.lang.String getUrlPathPrefix(javax.servlet.http.HttpServletRequest request)
public java.lang.String getRepositoryPath(javax.servlet.http.HttpServletRequest request)
public boolean isLockedOrReadOnly(org.alfresco.service.cmr.repository.NodeRef nodeRef)
nodeRef - the node referenceLockService#isLockedOrReadOnly(NodeRef)Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.