public abstract class AbstractLocatorFactory extends java.lang.Object implements DavLocatorFactory
AbstractLocatorFactory
is 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 of DavResourceLocator
builds the href. In contrast, the conversion from repository path to
resource path and vice versa is left to subclasses.Constructor and Description |
---|
AbstractLocatorFactory(java.lang.String pathPrefix)
Create a new factory
|
Modifier and Type | Method and Description |
---|---|
DavResourceLocator |
createResourceLocator(java.lang.String prefix,
java.lang.String href)
Create a new
DavResourceLocator . |
DavResourceLocator |
createResourceLocator(java.lang.String prefix,
java.lang.String href,
boolean forDestination)
Like
createResourceLocator(String, String) , but by setting
forDestination to true any special processing of URI
suffixes can be disabled. |
DavResourceLocator |
createResourceLocator(java.lang.String prefix,
java.lang.String workspacePath,
java.lang.String resourcePath)
Create a new
DavResourceLocator from the specified prefix,
workspace path and resource path, without modifying the specified Strings. |
DavResourceLocator |
createResourceLocator(java.lang.String prefix,
java.lang.String workspacePath,
java.lang.String path,
boolean isResourcePath)
Create a new
DavResourceLocator from the specified prefix,
workspace path and resource path. |
public AbstractLocatorFactory(java.lang.String pathPrefix)
pathPrefix
- Prefix, that needs to be removed in order to retrieve
the path of the repository item from a given DavResourceLocator
.public DavResourceLocator createResourceLocator(java.lang.String prefix, java.lang.String href)
DavResourceLocator
. 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 to null
.
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/anypathNOTE: If the given href is an absolute URI it must start with the specified prefix.
createResourceLocator
in interface DavLocatorFactory
prefix
- href
- DavResourceLocator
java.lang.IllegalArgumentException
- if the given href is null
public DavResourceLocator createResourceLocator(java.lang.String prefix, java.lang.String href, boolean forDestination)
createResourceLocator(String, String)
, but by setting
forDestination
to true
any special processing of URI
suffixes can be disabled.public DavResourceLocator createResourceLocator(java.lang.String prefix, java.lang.String workspacePath, java.lang.String resourcePath)
DavResourceLocator
from 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 are null
.createResourceLocator
in interface DavLocatorFactory
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.DavResourceLocator
DavLocatorFactory.createResourceLocator(String, String, String)
public DavResourceLocator createResourceLocator(java.lang.String prefix, java.lang.String workspacePath, java.lang.String path, boolean isResourcePath)
DavResourceLocator
from the specified prefix,
workspace path and resource path. If isResourcePath
is set
to false
, the given 'resourcePath' is converted by calling
getResourcePath(String, String)
. Otherwise the same restriction
applies as for createResourceLocator(String, String, String)
.createResourceLocator
in interface DavLocatorFactory
prefix
- workspacePath
- path
- isResourcePath
- DavLocatorFactory.createResourceLocator(String, String, String, boolean)
Copyright © 2010 - 2020 Adobe. All Rights Reserved