Package org.apache.jackrabbit.webdav
Class AbstractLocatorFactory
- java.lang.Object
- 
- org.apache.jackrabbit.webdav.AbstractLocatorFactory
 
- 
- All Implemented Interfaces:
- DavLocatorFactory
 - Direct Known Subclasses:
- DavLocatorFactoryImpl,- LocatorFactoryImplEx
 
 public abstract class AbstractLocatorFactory extends Object implements DavLocatorFactory AbstractLocatorFactoryis an implementation of the DavLocatorFactory interface that defines how a given URI is split to workspace path and resource path and how it's implementation ofDavResourceLocatorbuilds the href. In contrast, the conversion from repository path to resource path and vice versa is left to subclasses.
- 
- 
Constructor SummaryConstructors Constructor Description AbstractLocatorFactory(String pathPrefix)Create a new factory
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DavResourceLocatorcreateResourceLocator(String prefix, String href)Create a newDavResourceLocator.DavResourceLocatorcreateResourceLocator(String prefix, String href, boolean forDestination)LikecreateResourceLocator(String, String), but by settingforDestinationtotrueany special processing of URI suffixes can be disabled.DavResourceLocatorcreateResourceLocator(String prefix, String workspacePath, String resourcePath)Create a newDavResourceLocatorfrom the specified prefix, workspace path and resource path, without modifying the specified Strings.DavResourceLocatorcreateResourceLocator(String prefix, String workspacePath, String path, boolean isResourcePath)Create a newDavResourceLocatorfrom the specified prefix, workspace path and resource path.protected abstract StringgetRepositoryPath(String resourcePath, String wspPath)Subclasses must defined how the repository path is built from the given resource and workspace path.protected abstract StringgetResourcePath(String repositoryPath, String wspPath)Subclasses must defined how the resource path is built from the given repository and workspace path.
 
- 
- 
- 
Constructor Detail- 
AbstractLocatorFactorypublic AbstractLocatorFactory(String pathPrefix) Create a new factory- Parameters:
- pathPrefix- Prefix, that needs to be removed in order to retrieve the path of the repository item from a given- DavResourceLocator.
 
 
- 
 - 
Method Detail- 
createResourceLocatorpublic DavResourceLocator createResourceLocator(String prefix, String href) Create a newDavResourceLocator. Any leading prefix and path-prefix (as defined with the constructor) are removed from the given request handle. The same applies for trailing '/'. The remaining String is called the 'resource handle' and it's first segment is treated as workspace name. If resource handle (and therefore workspace name) are missing, both values are set tonull.Examples: http://www.foo.bar/ (path prefix missing) -> workspace path = null -> resource path = null -> href = http://www.foo.bar/pathPrefix/ http://www.foo.bar/pathPrefix/ -> workspace path = null -> resource path = null -> href = http://www.foo.bar/pathPrefix/ http://www.foo.bar/pathPrefix/wspName -> workspace path = /wspName -> resource path = /wspName -> href = http://www.foo.bar/pathPrefix/wspName http://www.foo.bar/pathPrefix/wspName/anypath -> workspace path = /wspName -> resource path = /wspName/anypath -> href = http://www.foo.bar/pathPrefix/wspName/anypath NOTE: If the given href is an absolute URI it must start with the specified prefix.- Specified by:
- createResourceLocatorin interface- DavLocatorFactory
- Parameters:
- prefix-
- href-
- Returns:
- a new DavResourceLocator
- Throws:
- IllegalArgumentException- if the given href is- null
 
 - 
createResourceLocatorpublic DavResourceLocator createResourceLocator(String prefix, String href, boolean forDestination) LikecreateResourceLocator(String, String), but by settingforDestinationtotrueany special processing of URI suffixes can be disabled.
 - 
createResourceLocatorpublic DavResourceLocator createResourceLocator(String prefix, String workspacePath, String resourcePath) Create a newDavResourceLocatorfrom the specified prefix, workspace path and resource path, without modifying the specified Strings. Note, that it is expected that the resource path starts with the given workspace path unless both values arenull.- Specified by:
- createResourceLocatorin interface- DavLocatorFactory
- Parameters:
- prefix-
- workspacePath- path or the workspace containing this resource or- null.
- resourcePath- Path of the resource or- null. Any non null value must start with the specified workspace path.
- Returns:
- a new DavResourceLocator
- See Also:
- DavLocatorFactory.createResourceLocator(String, String, String)
 
 - 
createResourceLocatorpublic DavResourceLocator createResourceLocator(String prefix, String workspacePath, String path, boolean isResourcePath) Create a newDavResourceLocatorfrom the specified prefix, workspace path and resource path. IfisResourcePathis set tofalse, the given 'resourcePath' is converted by callinggetResourcePath(String, String). Otherwise the same restriction applies as forcreateResourceLocator(String, String, String).- Specified by:
- createResourceLocatorin interface- DavLocatorFactory
- Parameters:
- prefix-
- workspacePath-
- path-
- isResourcePath-
- Returns:
- See Also:
- DavLocatorFactory.createResourceLocator(String, String, String, boolean)
 
 - 
getRepositoryPathprotected abstract String getRepositoryPath(String resourcePath, String wspPath) Subclasses must defined how the repository path is built from the given resource and workspace path.- Parameters:
- resourcePath-
- wspPath-
- Returns:
 
 
- 
 
-