Package org.apache.jackrabbit.webdav
Interface DavResource
- 
- All Known Subinterfaces:
- AclResource,- ActivityResource,- BaselineResource,- DeltaVResource,- ObservationResource,- OrderingResource,- TransactionResource,- VersionableResource,- VersionControlledResource,- VersionHistoryResource,- VersionResource,- WorkspaceResource
 - All Known Implementing Classes:
- DavResourceImpl,- DefaultItemCollection,- DefaultItemResource,- DeltaVResourceImpl,- EventJournalResourceImpl,- RootCollection,- VersionControlledItemCollection,- VersionControlledResourceImpl,- VersionHistoryItemCollection,- VersionHistoryResourceImpl,- VersionItemCollection,- VersionResourceImpl,- WorkspaceResourceImpl
 
 public interface DavResourceDavResourceprovides standard WebDAV functionality as specified by RFC 2518.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLockManager(LockManager lockmgr)Add an externalLockManagerto this resource.voidaddMember(DavResource resource, InputContext inputContext)Add the given resource as an internal member to this resource.MultiStatusResponsealterProperties(List<? extends PropEntry> changeList)Set/add and remove the specified properties from this resource.voidcopy(DavResource destination, boolean shallow)Copy this DavResource to the given destination resourcebooleanexists()Returns true if this webdav resource represents an existing repository item.DavResourcegetCollection()Retrieve the resource this resource is internal member of.StringgetComplianceClass()Returns a comma separated list of all compliance classes the given resource is fulfilling.StringgetDisplayName()Returns the display name of this resource.DavResourceFactorygetFactory()Return theDavResourceFactorythat created this resource.StringgetHref()Returns the absolute href of this resource as returned in the multistatus response body.DavResourceLocatorgetLocator()Returns thelocatorobject for this webdav resource, which encapsulates the information for building the complete 'href'.ActiveLockgetLock(Type type, Scope scope)Return the lock present on this webdav resource ornullif the resource is either not locked or not lockable at all.ActiveLock[]getLocks()Returns an array of all locks applied to the given resource.DavResourceIteratorgetMembers()Returns an iterator over all internal members.longgetModificationTime()Return the time of the last modification or -1 if the modification time could not be retrieved.DavPropertySetgetProperties()Returns all webdav properties present on this resource that will be return upon aDavConstants.PROPFIND_ALL_PROPrequest.DavProperty<?>getProperty(DavPropertyName name)Return the webdav property with the specified name.DavPropertyName[]getPropertyNames()Returns an array of allproperty namesavailable on this resource.StringgetResourcePath()Returns the path of the hierarchy element defined by thisDavResource.DavSessiongetSession()Retrieve theDavSessionassociated with this resource.StringgetSupportedMethods()Returns a comma separated list of all METHODS supported by the given resource.booleanhasLock(Type type, Scope scope)Returns true if a lock applies to this resource.booleanisCollection()Returns true if this webdav resource has the resourcetype 'collection'.booleanisLockable(Type type, Scope scope)Returns true, if the this resource allows locking.ActiveLocklock(LockInfo reqLockInfo)Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object.voidmove(DavResource destination)Move this DavResource to the given destination resourceActiveLockrefreshLock(LockInfo reqLockInfo, String lockToken)Refresh an existing lock by resetting the timeout.voidremoveMember(DavResource member)Removes the specified member from this resource.voidremoveProperty(DavPropertyName propertyName)Remove the specified property from this resource.voidsetProperty(DavProperty<?> property)Add/Set the specified property on this resource.voidspool(OutputContext outputContext)Spools the resource properties and ev.voidunlock(String lockToken)Remove the lock identified by the included lock token from this resource.
 
- 
- 
- 
Field Detail- 
METHODSstatic final String METHODS String constant representing the WebDAV 1 and 2 method set.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getComplianceClassString getComplianceClass() Returns a comma separated list of all compliance classes the given resource is fulfilling.- Returns:
- compliance classes
 
 - 
getSupportedMethodsString getSupportedMethods() Returns a comma separated list of all METHODS supported by the given resource.- Returns:
- METHODS supported by this resource.
 
 - 
existsboolean exists() Returns true if this webdav resource represents an existing repository item.- Returns:
- true, if the resource represents an existing repository item.
 
 - 
isCollectionboolean isCollection() Returns true if this webdav resource has the resourcetype 'collection'.- Returns:
- true if the resource represents a collection resource.
 
 - 
getDisplayNameString getDisplayName() Returns the display name of this resource.- Returns:
- display name.
 
 - 
getLocatorDavResourceLocator getLocator() Returns thelocatorobject for this webdav resource, which encapsulates the information for building the complete 'href'.- Returns:
- the locator for this resource.
- See Also:
- getResourcePath(),- getHref()
 
 - 
getResourcePathString getResourcePath() Returns the path of the hierarchy element defined by thisDavResource. This method is a shortcut forDavResource.getLocator().getResourcePath().- Returns:
- path of the element defined by this DavResource.
 
 - 
getHrefString getHref() Returns the absolute href of this resource as returned in the multistatus response body.- Returns:
- href
 
 - 
getModificationTimelong getModificationTime() Return the time of the last modification or -1 if the modification time could not be retrieved.- Returns:
- time of last modification or -1.
 
 - 
spoolvoid spool(OutputContext outputContext) throws IOException 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.- Parameters:
- outputContext- The output context.
- Throws:
- IOException- If an error occurs.
 
 - 
getPropertyNamesDavPropertyName[] getPropertyNames() Returns an array of allproperty namesavailable on this resource.- Returns:
- an array of property names.
 
 - 
getPropertyDavProperty<?> getProperty(DavPropertyName name) Return the webdav property with the specified name.- Parameters:
- name- name of the webdav property
- Returns:
- the DavPropertywith the given name ornullif the property does not exist.
 
 - 
getPropertiesDavPropertySet getProperties() Returns all webdav properties present on this resource that will be return upon aDavConstants.PROPFIND_ALL_PROPrequest. The implementation may in addition expose other (protected or calculated) properties which should be marked accordingly (see alsoDavProperty.isInvisibleInAllprop().- Returns:
- a DavPropertySetcontaining at least all properties of this resource that are exposed in 'allprop' PROPFIND request.
 
 - 
setPropertyvoid setProperty(DavProperty<?> property) throws DavException Add/Set the specified property on this resource.- Parameters:
- property-
- Throws:
- DavException- if an error occurs
 
 - 
removePropertyvoid removeProperty(DavPropertyName propertyName) throws DavException Remove the specified property from this resource.- Parameters:
- propertyName-
- Throws:
- DavException- if an error occurs
 
 - 
alterPropertiesMultiStatusResponse alterProperties(List<? extends PropEntry> changeList) throws DavException Set/add and remove the specified properties from this resource.- Parameters:
- changeList- list containing- DavPropertyNameobjects (for properties to be removed) and- DavPropertyobjects (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).
 
 - 
getCollectionDavResource getCollection() Retrieve the resource this resource is internal member of.- Returns:
- resource this resource is an internal member of. In case this resource
 is the root nullis returned.
 
 - 
addMembervoid addMember(DavResource resource, InputContext inputContext) throws DavException Add the given resource as an internal member to this resource.- Parameters:
- resource-- DavResourceto be added as internal member.
- inputContext- Context providing the properties and content for the internal member to be created or replaced.
- Throws:
- DavException
 
 - 
getMembersDavResourceIterator getMembers() Returns an iterator over all internal members.- Returns:
- a DavResourceIteratorover all internal members.
 
 - 
removeMembervoid removeMember(DavResource member) throws DavException Removes the specified member from this resource.- Throws:
- DavException
 
 - 
movevoid move(DavResource destination) throws DavException Move this DavResource to the given destination resource- Parameters:
- destination-
- Throws:
- DavException
 
 - 
copyvoid copy(DavResource destination, boolean shallow) throws DavException Copy this DavResource to the given destination resource- Parameters:
- destination-
- shallow-
- Throws:
- DavException
 
 - 
isLockableboolean isLockable(Type type, Scope scope) Returns true, if the this resource allows locking. NOTE, that this method does not define, whether a lock/unlock can be successfully executed.- Parameters:
- type-
- scope-
- Returns:
- true, if this resource supports any locking.
 
 - 
hasLockboolean hasLock(Type type, Scope scope) Returns true if a lock applies to this resource. This may be either a lock on this resource itself or a deep lock inherited from a collection above this resource.
 Note, that true is returned whenever a lock applies to that resource even if the lock is expired or not effective due to the fact that the request provides the proper lock token.- Parameters:
- type-
- Returns:
- true if a lock applies to this resource.
 
 - 
getLockActiveLock getLock(Type type, Scope scope) Return the lock present on this webdav resource ornullif 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.- Parameters:
- type-
- Returns:
- lock information of this resource or nullif this resource has no lock applying it. If an error occurs while retrieving the lock informationnullis returned as well.
 
 - 
getLocksActiveLock[] getLocks() Returns an array of all locks applied to the given resource.- Returns:
- array of locks. The array is empty if there are no locks applied to this resource.
 
 - 
lockActiveLock lock(LockInfo reqLockInfo) throws DavException Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object.- 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 DavExceptionis thrown.
- Throws:
- DavException- if the lock could not be obtained.
 
 - 
refreshLockActiveLock refreshLock(LockInfo reqLockInfo, String lockToken) throws DavException Refresh an existing lock by resetting the timeout.- Parameters:
- reqLockInfo- lock info as retrieved from the request.
- lockToken- identifying the lock to be refreshed.
- Returns:
- lockdiscovery object to be returned in the response body. If the lock
 could not be refreshed a DavExceptionis thrown.
- Throws:
- DavException- if the lock could not be refreshed.
 
 - 
unlockvoid unlock(String lockToken) throws DavException Remove the lock identified by the included lock token from this resource. This method will return false if the unlocking did not succeed.- Parameters:
- lockToken- identifying the lock to be removed.
- Throws:
- DavException- if the lock could not be removed.
 
 - 
addLockManagervoid addLockManager(LockManager lockmgr) Add an externalLockManagerto this resource. This method may throwUnsupportedOperationExceptionif the resource does handle locking itself.- Parameters:
- lockmgr-
- See Also:
- LockManager
 
 - 
getFactoryDavResourceFactory getFactory() Return theDavResourceFactorythat created this resource.- Returns:
- the factory that created this resource.
 
 - 
getSessionDavSession getSession() Retrieve theDavSessionassociated with this resource.- Returns:
- session object associated with this resource.
 
 
- 
 
-