Package org.apache.jackrabbit.webdav.jcr
Class WorkspaceResourceImpl
- java.lang.Object
-
- org.apache.jackrabbit.webdav.jcr.WorkspaceResourceImpl
-
- All Implemented Interfaces:
DavResource
,SearchResource
,TransactionResource
,DeltaVResource
,VersionableResource
,VersionControlledResource
,WorkspaceResource
public class WorkspaceResourceImpl extends Object implements WorkspaceResource, VersionControlledResource
WorkspaceResourceImpl
...
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
initedProps
protected DavPropertyNameSet
names
protected DavPropertySet
properties
protected SupportedLock
supportedLock
protected SupportedReportSetProperty
supportedReports
-
Fields inherited from interface org.apache.jackrabbit.webdav.DavResource
METHODS
-
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
METHODS, METHODS_INCL_MKWORKSPACE
-
Fields inherited from interface org.apache.jackrabbit.webdav.search.SearchResource
METHODS
-
Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionResource
METHODS
-
Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionableResource
METHODS
-
Fields inherited from interface org.apache.jackrabbit.webdav.version.VersionControlledResource
ACTIVITY_SET, AUTO_MERGE_SET, AUTO_VERSION, BASELINE_CONTROLLED_COLLECTION, CHECKED_IN, CHECKED_OUT, CHECKIN_FORK, CHECKOUT_FORK, ECLIPSED_SET, MERGE_SET, methods_checkedIn, methods_checkedOut, PREDECESSOR_SET, SUBBASELINE_SET, UNRESERVED, VERSION_HISTORY
-
Fields inherited from interface org.apache.jackrabbit.webdav.version.WorkspaceResource
BASELINE_CONTROLLED_COLLECTION_SET, CURRENT_ACTIVITY_SET, CUURENT_ACTIVITY_SET, WORKSPACE_CHECKOUT_SET
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLockManager(LockManager lockMgr)
Add an externalLockManager
to this resource.void
addMember(DavResource resource, InputContext inputContext)
Throws 403 exception (Forbidden)void
addVersionControl()
Converts this versionable resource into a version-controlled resource.void
addWorkspace(DavResource workspace)
The JCR api does not provide methods to create new workspaces.MultiStatusResponse
alterProperties(List<? extends PropEntry> changeList)
Handles an attempt to setItemResourceConstants.JCR_NAMESPACES
and forwards any other set or remove requests to the super class.String
checkin()
Perform a checkin on the version controlled resource.void
checkout()
Perform a checkout on the version controlled resource.void
copy(DavResource destination, boolean shallow)
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
protected DavResource
createResourceFromLocator(DavResourceLocator loc)
Create a newDavResource
from the given locator.boolean
exists()
Returns true if this webdav resource represents an existing repository item.DavResource
getCollection()
Retrieve the collection that has all workspace collections as internal members.String
getComplianceClass()
Returns a string listing the compliance classes for this resource as it is required for the DAV response header.protected String
getCreationDate()
Returns the creation date which is used for theDavPropertyName.CREATIONDATE
property.protected String
getCreatorDisplayName()
Returns the display name of the creator which is used for the protectedDeltaVConstants.CREATOR_DISPLAYNAME
property.String
getDisplayName()
Returns the name of the workspace.DavResourceFactory
getFactory()
Return theDavResourceFactory
that created this resource.String
getHref()
Returns the absolute href of this resource as returned in the multistatus response body.DavResourceLocator
getLocator()
Returns thelocator
object for this webdav resource, which encapsulates the information for building the complete 'href'.protected DavResourceLocator
getLocatorFromItem(Item repositoryItem)
Build a newDavResourceLocator
from the given repository item.protected DavResourceLocator
getLocatorFromItemPath(String itemPath)
Build aDavResourceLocator
from the given itemPath path.ActiveLock
getLock(Type type, Scope scope)
Return the lock present on this webdav resource ornull
if the resource is either not locked or not lockable at all.ActiveLock[]
getLocks()
Returns an array of all locks applied to the given resource.DavResourceIterator
getMembers()
Returns the resource representing the JCR root node.long
getModificationTime()
Always returns 'now'OptionsResponse
getOptionResponse(OptionsInfo optionsInfo)
Retrieves the information requested in the OPTIONS request body and returns the corresponding values.DavPropertySet
getProperties()
Returns all webdav properties present on this resource that will be return upon aDavConstants.PROPFIND_ALL_PROP
request.DavProperty<?>
getProperty(DavPropertyName name)
Return the webdav property with the specified name.DavPropertyName[]
getPropertyNames()
Returns an array of allproperty names
available on this resource.QueryGrammerSet
getQueryGrammerSet()
Returns the protected DAV:supported-method-set property which is defined mandatory by RTF 3253.DavResource[]
getReferenceResources(DavPropertyName hrefPropertyName)
Return an array ofDavResource
objects that are referenced by the property with the specified name.Report
getReport(ReportInfo reportInfo)
Runs the report specified by the givenReportInfo
.protected Session
getRepositorySession()
Shortcut forgetSession().getRepositorySession()
String
getResourcePath()
Returns the path of the underlying repository item or the item to be created (PUT/MKCOL).DavSession
getSession()
Retrieve theDavSession
associated with this resource.String
getSupportedMethods()
Returns a comma separated list of all METHODS supported by the given resource.String
getTransactionId()
The TransactionId ornull
according to the value of the corresponding requestheader
field.VersionHistoryResource
getVersionHistory()
Returns theVersionHistoryResource
, that is referenced in the 'version-history
' property.protected String
getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to.boolean
hasLock(Type type, Scope scope)
Returns true if this resource has a lock applied with the given type and scope.void
init(TxLockManager txMgr, String transactionId)
Initializes theTransactionResource
.protected void
initLockSupport()
Define the set of locks supported by this resource.protected void
initProperties()
Fill the set of default propertiesprotected void
initPropertyNames()
Property names common to all resources.protected void
initSupportedReports()
Define the set of reports supported by this resource.boolean
isCollection()
Returns true if this webdav resource has the resourcetype 'collection'.boolean
isLockable(Type type, Scope scope)
Returns true, if theSupportedLock
property contains an entry with the given type and scope.void
label(LabelInfo labelInfo)
Modify the labels of the version referenced by the DAV:checked-in property of this checked-in version-controlled resource.ActiveLock
lock(LockInfo reqLockInfo)
Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object.MultiStatus
merge(MergeInfo mergeInfo)
Perform a merge on this resource using the specifiedMergeInfo
.void
move(DavResource destination)
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
protected String
normalizeResourceHref(String href)
Normalize the resourcehref
.ActiveLock
refreshLock(LockInfo info, String lockToken)
Only transaction lock may be available on this resource.void
removeMember(DavResource member)
Throws 403 exception (Forbidden)void
removeProperty(DavPropertyName propertyName)
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
MultiStatus
search(SearchInfo sInfo)
Runs a search with the language and query defined in theSearchInfo
object specified and returns aMultiStatus
object listing the results.void
setProperty(DavProperty<?> property)
Allows to alter the registered namespaces (ItemResourceConstants.JCR_NAMESPACES
) or register node typesItemResourceConstants.JCR_NODETYPES_CND
where the passed value is a cnd string containing the definition and forwards any other property to the super class.void
spool(OutputContext outputContext)
Spools the resource properties and ev.void
uncheckout()
Perform an uncheckout on the version controlled resource.void
unlock(String lockToken)
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
since only transaction locks may be present on this resource, that need to be released by callingTransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
.void
unlock(String lockToken, TransactionInfo tInfo)
Overloads theunlock
method of theDavResource
interface.MultiStatus
update(UpdateInfo updateInfo)
While RFC 3253 does not define any version-related operations for the workspace resource, this implementation usesVersionControlledResource.update(UpdateInfo)
to mapWorkspace.restore(javax.jcr.version.Version[], boolean)
to a WebDAV call.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.webdav.DavResource
addLockManager, copy, getComplianceClass, getFactory, getHref, getLocator, getLock, getLocks, getProperties, getPropertyNames, getResourcePath, getSession, hasLock, isLockable, lock, move, refreshLock, removeProperty, unlock
-
Methods inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
addWorkspace, getOptionResponse, getReferenceResources, getReport
-
-
-
-
Field Detail
-
initedProps
protected boolean initedProps
-
properties
protected DavPropertySet properties
-
names
protected DavPropertyNameSet names
-
supportedLock
protected SupportedLock supportedLock
-
supportedReports
protected SupportedReportSetProperty supportedReports
-
-
Method Detail
-
getProperty
public DavProperty<?> getProperty(DavPropertyName name)
Description copied from interface:DavResource
Return the webdav property with the specified name.- Specified by:
getProperty
in interfaceDavResource
- Parameters:
name
- name of the webdav property- Returns:
- the
DavProperty
with the given name ornull
if the property does not exist. - See Also:
DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
getSupportedMethods
public String getSupportedMethods()
Description copied from interface:DavResource
Returns a comma separated list of all METHODS supported by the given resource.- Specified by:
getSupportedMethods
in interfaceDavResource
- Returns:
- METHODS supported by this resource.
-
exists
public boolean exists()
Description copied from interface:DavResource
Returns true if this webdav resource represents an existing repository item.- Specified by:
exists
in interfaceDavResource
- Returns:
- true if the workspace name (see
getDisplayName()
is present in the list of available workspace names such as exposed by the editing JCR session.
-
isCollection
public boolean isCollection()
Description copied from interface:DavResource
Returns true if this webdav resource has the resourcetype 'collection'.- Specified by:
isCollection
in interfaceDavResource
- Returns:
- true
-
getDisplayName
public String getDisplayName()
Returns the name of the workspace.- Specified by:
getDisplayName
in interfaceDavResource
- Returns:
- The workspace name
- See Also:
DavResource.getDisplayName()
,Workspace.getName()
-
getModificationTime
public long getModificationTime()
Always returns 'now'- Specified by:
getModificationTime
in interfaceDavResource
- Returns:
-
spool
public void spool(OutputContext outputContext) throws IOException
Description copied from interface:DavResource
Spools the resource properties and ev. content to the specified context (e.g. to respond to a 'GET' or 'HEAD' request). The context could e.g. wrap the servlet response.- Specified by:
spool
in interfaceDavResource
- Parameters:
outputContext
-- Throws:
IOException
-
getCollection
public DavResource getCollection()
Retrieve the collection that has all workspace collections as internal members.- Specified by:
getCollection
in interfaceDavResource
- Returns:
- resource this resource is an internal member of. In case this resource
is the root
null
is returned. - See Also:
DavResource.getCollection()
-
addMember
public void addMember(DavResource resource, InputContext inputContext) throws DavException
Throws 403 exception (Forbidden)- Specified by:
addMember
in interfaceDavResource
- Parameters:
resource
-inputContext
-- Throws:
DavException
-
getMembers
public DavResourceIterator getMembers()
Returns the resource representing the JCR root node.- Specified by:
getMembers
in interfaceDavResource
- Returns:
-
removeMember
public void removeMember(DavResource member) throws DavException
Throws 403 exception (Forbidden)- Specified by:
removeMember
in interfaceDavResource
- Parameters:
member
-- Throws:
DavException
-
setProperty
public void setProperty(DavProperty<?> property) throws DavException
Allows to alter the registered namespaces (ItemResourceConstants.JCR_NAMESPACES
) or register node typesItemResourceConstants.JCR_NODETYPES_CND
where the passed value is a cnd string containing the definition and forwards any other property to the super class.Note that again no property status is set. Any failure while setting a property results in an exception (violating RFC 2518).
- Specified by:
setProperty
in interfaceDavResource
- Parameters:
property
-- Throws:
DavException
- See Also:
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
-
alterProperties
public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList) throws DavException
Handles an attempt to setItemResourceConstants.JCR_NAMESPACES
and forwards any other set or remove requests to the super class.- Specified by:
alterProperties
in interfaceDavResource
- Parameters:
changeList
- list containingDavPropertyName
objects (for properties to be removed) andDavProperty
objects (for properties to be added/set).- Returns:
- multistatus response listing the status resulting from setting and/or removing the specified properties, in order to allow a detailed multistatus response.
- Throws:
DavException
- if an error occurred. This may be the case if the general state of the resource prevents any properties to be set or removed (e.g. due to a lock).- See Also:
setProperty(DavProperty)
,DefaultItemCollection.alterProperties(List)
-
addVersionControl
public void addVersionControl() throws DavException
Description copied from interface:VersionableResource
Converts this versionable resource into a version-controlled resource. If this resource is already version-controlled this resource is not affected. If however, this resource is not versionable anDavException
(error code:HttpServletResponse.SC_METHOD_NOT_ALLOWED
is thrown. The same applies, if this resource is versionable but its current state does not allow to made it a version-controlled one or if any other error occurs.- Specified by:
addVersionControl
in interfaceVersionableResource
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
checkin
public String checkin() throws DavException
Description copied from interface:VersionControlledResource
Perform a checkin on the version controlled resource.- Specified by:
checkin
in interfaceVersionControlledResource
- Returns:
- String representing the location of the version created by the checkin.
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
checkout
public void checkout() throws DavException
Description copied from interface:VersionControlledResource
Perform a checkout on the version controlled resource.- Specified by:
checkout
in interfaceVersionControlledResource
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
uncheckout
public void uncheckout() throws DavException
Description copied from interface:VersionControlledResource
Perform an uncheckout on the version controlled resource.- Specified by:
uncheckout
in interfaceVersionControlledResource
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
update
public MultiStatus update(UpdateInfo updateInfo) throws DavException
While RFC 3253 does not define any version-related operations for the workspace resource, this implementation usesVersionControlledResource.update(UpdateInfo)
to mapWorkspace.restore(javax.jcr.version.Version[], boolean)
to a WebDAV call.Limitation: note that the
MultiStatus
returned by this method will not list any nodes that have been removed due to an Uuid conflict.- Specified by:
update
in interfaceVersionControlledResource
- Parameters:
updateInfo
-- Returns:
- Throws:
DavException
- See Also:
VersionControlledResource.update(org.apache.jackrabbit.webdav.version.UpdateInfo)
-
merge
public MultiStatus merge(MergeInfo mergeInfo) throws DavException
Description copied from interface:VersionControlledResource
Perform a merge on this resource using the specifiedMergeInfo
.- Specified by:
merge
in interfaceVersionControlledResource
- Returns:
MultiStatus
containing the list of resources that have been modified.- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
label
public void label(LabelInfo labelInfo) throws DavException
Description copied from interface:VersionControlledResource
Modify the labels of the version referenced by the DAV:checked-in property of this checked-in version-controlled resource. If the resource is not checked-in the request must fail.- Specified by:
label
in interfaceVersionControlledResource
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.- See Also:
LabelInfo
,for the pre- and postcondition of a successful LABEL request.
-
getVersionHistory
public VersionHistoryResource getVersionHistory() throws DavException
Description copied from interface:VersionControlledResource
Returns theVersionHistoryResource
, that is referenced in the 'version-history
' property.- Specified by:
getVersionHistory
in interfaceVersionControlledResource
- Returns:
- Throws:
DavException
- (403) since workspace is not versionable. implementingVersionControlledResource
only for 'update'.
-
initLockSupport
protected void initLockSupport()
Define the set of locks supported by this resource.- See Also:
SupportedLock
-
initSupportedReports
protected void initSupportedReports()
Define the set of reports supported by this resource.- See Also:
SupportedReportSetProperty
,AbstractResource.initSupportedReports()
-
getWorkspaceHref
protected String getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to.- Returns:
- href of the workspace
-
initPropertyNames
protected void initPropertyNames()
Property names common to all resources.
-
initProperties
protected void initProperties()
Fill the set of default properties
-
getComplianceClass
public String getComplianceClass()
Returns a string listing the compliance classes for this resource as it is required for the DAV response header. This includes DAV 1, 2 which is supported by all derived classes as well as a subset of the classes defined by DeltaV: version-control, version-history, checkout-in-place, label, merge, update and workspace.
Those compliance classes are added as required by RFC3253 since all all resources in the jcr-server support at least the reporting and some basic versioning functionality.- Specified by:
getComplianceClass
in interfaceDavResource
- Returns:
- string listing the compliance classes.
- See Also:
DavResource.getComplianceClass()
-
getLocator
public DavResourceLocator getLocator()
Description copied from interface:DavResource
Returns thelocator
object for this webdav resource, which encapsulates the information for building the complete 'href'.- Specified by:
getLocator
in interfaceDavResource
- Returns:
- the locator for this resource.
- See Also:
DavResource.getLocator()
-
getResourcePath
public String getResourcePath()
Returns the path of the underlying repository item or the item to be created (PUT/MKCOL). If the resource exists but does not represent a repository itemnull
is returned.- Specified by:
getResourcePath
in interfaceDavResource
- Returns:
- path of the underlying repository item.
- See Also:
DavResource.getResourcePath()
,DavResourceLocator.getResourcePath()
-
getHref
public String getHref()
Description copied from interface:DavResource
Returns the absolute href of this resource as returned in the multistatus response body.- Specified by:
getHref
in interfaceDavResource
- Returns:
- href
- See Also:
DavResource.getHref()
,DavResourceLocator.getHref(boolean)
-
getPropertyNames
public DavPropertyName[] getPropertyNames()
Description copied from interface:DavResource
Returns an array of allproperty names
available on this resource.- Specified by:
getPropertyNames
in interfaceDavResource
- Returns:
- an array of property names.
- See Also:
DavResource.getPropertyNames()
-
getProperties
public DavPropertySet getProperties()
Description copied from interface:DavResource
Returns all webdav properties present on this resource that will be return upon aDavConstants.PROPFIND_ALL_PROP
request. The implementation may in addition expose other (protected or calculated) properties which should be marked accordingly (see alsoDavProperty.isInvisibleInAllprop()
.- Specified by:
getProperties
in interfaceDavResource
- Returns:
- a
DavPropertySet
containing at least all properties of this resource that are exposed in 'allprop' PROPFIND request. - See Also:
DavResource.getProperties()
-
removeProperty
public void removeProperty(DavPropertyName propertyName) throws DavException
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- Specified by:
removeProperty
in interfaceDavResource
- Parameters:
propertyName
-- Throws:
DavException
- Always throwsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- See Also:
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
move
public void move(DavResource destination) throws DavException
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- Specified by:
move
in interfaceDavResource
- Parameters:
destination
-- Throws:
DavException
- Always throwsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- See Also:
DavResource.move(org.apache.jackrabbit.webdav.DavResource)
-
copy
public void copy(DavResource destination, boolean shallow) throws DavException
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- Specified by:
copy
in interfaceDavResource
- Parameters:
destination
-shallow
-- Throws:
DavException
- Always throwsHttpServletResponse.SC_METHOD_NOT_ALLOWED
- See Also:
DavResource.copy(org.apache.jackrabbit.webdav.DavResource, boolean)
-
isLockable
public boolean isLockable(Type type, Scope scope)
Returns true, if theSupportedLock
property contains an entry with the given type and scope. By default resources allow fortransaction
lock only.- Specified by:
isLockable
in interfaceDavResource
- Parameters:
type
-scope
-- Returns:
- true if this resource may be locked by the given type and scope.
- See Also:
DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
-
hasLock
public boolean hasLock(Type type, Scope scope)
Returns true if this resource has a lock applied with the given type and scope.- Specified by:
hasLock
in interfaceDavResource
- Parameters:
type
-scope
-- Returns:
- true if this resource has a lock applied with the given type and scope.
- See Also:
DavResource.hasLock(Type, Scope)
-
getLock
public ActiveLock getLock(Type type, Scope scope)
Description copied from interface:DavResource
Return the lock present on this webdav resource ornull
if the resource is either not locked or not lockable at all. Note, that a resource may have a lock that is inherited by a deep lock enforced on one of its 'parent' resources.- Specified by:
getLock
in interfaceDavResource
- Returns:
- lock information of this resource or
null
if this resource has no lock applying it. If an error occurs while retrieving the lock informationnull
is returned as well. - See Also:
DavResource.getLock(Type, Scope)
-
getLocks
public ActiveLock[] getLocks()
Description copied from interface:DavResource
Returns an array of all locks applied to the given resource.- Specified by:
getLocks
in interfaceDavResource
- Returns:
- array of locks. The array is empty if there are no locks applied to this resource.
- See Also:
todo improve....
-
lock
public ActiveLock lock(LockInfo reqLockInfo) throws DavException
Description copied from interface:DavResource
Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object.- Specified by:
lock
in interfaceDavResource
- Parameters:
reqLockInfo
- lock info as retrieved from the request.- Returns:
- lockdiscovery object to be returned in the response. If the lock
could not be obtained a
DavException
is thrown. - Throws:
DavException
- if the lock could not be obtained.- See Also:
DavResource.lock(org.apache.jackrabbit.webdav.lock.LockInfo)
-
refreshLock
public ActiveLock refreshLock(LockInfo info, String lockToken) throws DavException
Only transaction lock may be available on this resource.- Specified by:
refreshLock
in interfaceDavResource
- Parameters:
info
-lockToken
-- Returns:
- lockdiscovery object to be returned in the response body. If the lock
could not be refreshed a
DavException
is thrown. - Throws:
DavException
- See Also:
DavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)
-
unlock
public void unlock(String lockToken) throws DavException
ThrowsHttpServletResponse.SC_METHOD_NOT_ALLOWED
since only transaction locks may be present on this resource, that need to be released by callingTransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
.- Specified by:
unlock
in interfaceDavResource
- Parameters:
lockToken
-- Throws:
DavException
- Always throwsHttpServletResponse.SC_METHOD_NOT_ALLOWED
-
addLockManager
public void addLockManager(LockManager lockMgr)
Description copied from interface:DavResource
Add an externalLockManager
to this resource. This method may throwUnsupportedOperationException
if the resource does handle locking itself.- Specified by:
addLockManager
in interfaceDavResource
- See Also:
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)
-
getFactory
public DavResourceFactory getFactory()
Description copied from interface:DavResource
Return theDavResourceFactory
that created this resource.- Specified by:
getFactory
in interfaceDavResource
- Returns:
- the factory that created this resource.
- See Also:
DavResource.getFactory()
-
getSession
public DavSession getSession()
Description copied from interface:DavResource
Retrieve theDavSession
associated with this resource.- Specified by:
getSession
in interfaceDavResource
- Returns:
- session object associated with this resource.
- See Also:
DavResource.getSession()
,DavResource.getSession()
-
init
public void init(TxLockManager txMgr, String transactionId)
Description copied from interface:TransactionResource
Initializes theTransactionResource
.- Specified by:
init
in interfaceTransactionResource
- See Also:
TransactionResource.init(TxLockManager, String)
-
unlock
public void unlock(String lockToken, TransactionInfo tInfo) throws DavException
Description copied from interface:TransactionResource
Overloads theunlock
method of theDavResource
interface.- Specified by:
unlock
in interfaceTransactionResource
- Parameters:
lockToken
- lock token as present in the request header.tInfo
- transaction info object as present in the UNLOCK request body.- Throws:
DavException
- if an error occurs- See Also:
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)
-
getTransactionId
public String getTransactionId()
Description copied from interface:TransactionResource
The TransactionId ornull
according to the value of the corresponding requestheader
field.- Specified by:
getTransactionId
in interfaceTransactionResource
- Returns:
- TransactionId header or
null
- See Also:
TransactionResource.getTransactionId()
-
getOptionResponse
public OptionsResponse getOptionResponse(OptionsInfo optionsInfo)
Description copied from interface:DeltaVResource
Retrieves the information requested in the OPTIONS request body and returns the corresponding values.- Specified by:
getOptionResponse
in interfaceDeltaVResource
- Parameters:
optionsInfo
-- Returns:
- object to be used in the OPTIONS response body or
null
- See Also:
DeltaVResource.getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo)
-
getReport
public Report getReport(ReportInfo reportInfo) throws DavException
Description copied from interface:DeltaVResource
Runs the report specified by the givenReportInfo
.- Specified by:
getReport
in interfaceDeltaVResource
- Parameters:
reportInfo
-- Returns:
- the requested report
- Throws:
DavException
- See Also:
DeltaVResource.getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo)
-
addWorkspace
public void addWorkspace(DavResource workspace) throws DavException
The JCR api does not provide methods to create new workspaces. CallingaddWorkspace
on this resource will always fail.- Specified by:
addWorkspace
in interfaceDeltaVResource
- Parameters:
workspace
-- Throws:
DavException
- Always throws.- See Also:
DeltaVResource.addWorkspace(org.apache.jackrabbit.webdav.DavResource)
-
getReferenceResources
public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName) throws DavException
Return an array ofDavResource
objects that are referenced by the property with the specified name.- Specified by:
getReferenceResources
in interfaceDeltaVResource
- Parameters:
hrefPropertyName
-- Returns:
- array of
DavResource
s - Throws:
DavException
- See Also:
DeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
getQueryGrammerSet
public QueryGrammerSet getQueryGrammerSet()
Description copied from interface:SearchResource
Returns the protected DAV:supported-method-set property which is defined mandatory by RTF 3253. This method call is a shortcut forDavResource.getProperty(SearchConstants.QUERY_GRAMMER_SET)
.- Specified by:
getQueryGrammerSet
in interfaceSearchResource
- Returns:
- See Also:
SearchResource.getQueryGrammerSet()
-
search
public MultiStatus search(SearchInfo sInfo) throws DavException
Description copied from interface:SearchResource
Runs a search with the language and query defined in theSearchInfo
object specified and returns aMultiStatus
object listing the results.- Specified by:
search
in interfaceSearchResource
- Parameters:
sInfo
-- Returns:
- Throws:
DavException
- See Also:
SearchResource.search(org.apache.jackrabbit.webdav.search.SearchInfo)
-
createResourceFromLocator
protected DavResource createResourceFromLocator(DavResourceLocator loc) throws DavException
Create a newDavResource
from the given locator.- Parameters:
loc
-- Returns:
- new
DavResource
- Throws:
DavException
-
getLocatorFromItemPath
protected DavResourceLocator getLocatorFromItemPath(String itemPath)
Build aDavResourceLocator
from the given itemPath path.- Parameters:
itemPath
-- Returns:
- a new
DavResourceLocator
- See Also:
DavLocatorFactory.createResourceLocator(String, String, String)
-
getLocatorFromItem
protected DavResourceLocator getLocatorFromItem(Item repositoryItem)
Build a newDavResourceLocator
from the given repository item.- Parameters:
repositoryItem
-- Returns:
- a new locator for the specified item.
- See Also:
getLocatorFromItemPath(String)
-
getRepositorySession
protected Session getRepositorySession()
Shortcut forgetSession().getRepositorySession()
- Returns:
- repository session present in the
AbstractResource.session
.
-
getCreatorDisplayName
protected String getCreatorDisplayName()
Returns the display name of the creator which is used for the protectedDeltaVConstants.CREATOR_DISPLAYNAME
property.- Returns:
- always
null
; subclasses may provide a regular value.
-
getCreationDate
protected String getCreationDate()
Returns the creation date which is used for theDavPropertyName.CREATIONDATE
property.- Returns:
- a dummy date; subclasses may provide a reasonable value.
-
-