Package org.apache.jackrabbit.webdav.jcr
Class VersionControlledItemCollection
- java.lang.Object
-
- org.apache.jackrabbit.webdav.jcr.DefaultItemCollection
-
- org.apache.jackrabbit.webdav.jcr.VersionControlledItemCollection
-
- All Implemented Interfaces:
JcrRemotingConstants,DavResource,ItemResourceConstants,ObservationResource,OrderingResource,SearchResource,TransactionResource,DeltaVResource,VersionableResource,VersionControlledResource
public class VersionControlledItemCollection extends DefaultItemCollection implements VersionControlledResource
VersionControlledItemCollectionrepresents a JCR node item and covers all functionality related to versioning ofNodes.- See Also:
Node
-
-
Field Summary
Fields Modifier and Type Field Description protected booleaninitedPropsprotected Itemitemprotected DavPropertyNameSetnamesprotected DavPropertySetpropertiesprotected SupportedLocksupportedLockprotected SupportedReportSetPropertysupportedReports-
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.jcr.ItemResourceConstants
EXCLUSIVE_SESSION, JCR_DEFINITION, JCR_DEPTH, JCR_GET_STRING, JCR_INDEX, JCR_ISMODIFIED, JCR_ISNEW, JCR_LENGTH, JCR_LENGTHS, JCR_MIXINNODETYPES, JCR_NAME, JCR_NAMESPACES, JCR_NODETYPES_CND, JCR_PARENT, JCR_PATH, JCR_PRIMARYITEM, JCR_PRIMARYNODETYPE, JCR_REFERENCES, JCR_SELECTOR_NAME, JCR_TYPE, JCR_UUID, JCR_VALUE, JCR_VALUES, JCR_VERSIONABLEUUID, JCR_WEAK_REFERENCES, JCR_WORKSPACE_NAME, METHODS, NAMESPACE, PRIVILEGE_JCR_ADD_NODE, PRIVILEGE_JCR_READ, PRIVILEGE_JCR_REMOVE, PRIVILEGE_JCR_SET_PROPERTY
-
Fields inherited from interface org.apache.jackrabbit.commons.webdav.JcrRemotingConstants
ATTR_VALUE_TYPE, IMPORT_UUID_BEHAVIOR, JCR_DEFINITION_LN, JCR_DEPTH_LN, JCR_GET_STRING_LN, JCR_INDEX_LN, JCR_ISMODIFIED_LN, JCR_ISNEW_LN, JCR_LENGTH_LN, JCR_LENGTHS_LN, JCR_MIXINNODETYPES_LN, JCR_NAME_LN, JCR_NAMESPACES_LN, JCR_NODETYPES_CND_LN, JCR_PARENT_LN, JCR_PATH_LN, JCR_PRIMARYITEM_LN, JCR_PRIMARYNODETYPE_LN, JCR_QUERY_RESULT_LN, JCR_REFERENCES_LN, JCR_SELECTOR_NAME_LN, JCR_TYPE_LN, JCR_UUID_LN, JCR_VALUE_LN, JCR_VALUES_LN, JCR_VERSIONABLEUUID_LN, JCR_WEAK_REFERENCES_LN, JCR_WORKSPACE_NAME_LN, NS_PREFIX, NS_URI, RELATION_REMOTE_SESSION_ID, RELATION_USER_DATA, REPORT_EXPORT_VIEW, REPORT_LOCATE_BY_UUID, REPORT_LOCATE_CORRESPONDING_NODE, REPORT_NODETYPES, REPORT_PRIVILEGES, REPORT_REGISTERED_NAMESPACES, REPORT_REPOSITORY_DESCRIPTORS, ROOT_ITEM_PATH, ROOT_ITEM_RESOURCEPATH, VERSIONSTORAGE_PATH, XML_ALLOWUPDATE, XML_CND, XML_DESCRIPTOR, XML_DESCRIPTORKEY, XML_DESCRIPTORVALUE, XML_EXCLUSIVE_SESSION_SCOPED, XML_LENGTH, XML_NAMESPACE, XML_NODETYPENAME, XML_PREFIX, XML_PRIMARYNODETYPE, XML_QUERY_RESULT_COLUMN, XML_RELPATH, XML_REMOVEEXISTING, XML_URI, XML_VALUE
-
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationResource
METHODS
-
Fields inherited from interface org.apache.jackrabbit.webdav.ordering.OrderingResource
METHODS
-
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
-
-
Constructor Summary
Constructors Constructor Description VersionControlledItemCollection(DavResourceLocator locator, JcrDavSession session, DavResourceFactory factory, Item item)Create a newVersionControlledItemCollection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLockManager(LockManager lockMgr)Add an externalLockManagerto this resource.voidaddVersionControl()Adds version control to this resource.voidaddWorkspace(DavResource workspace)The JCR api does not provide methods to create new workspaces.MultiStatusResponsealterProperties(List<? extends PropEntry> changeList)Loops over the givenLists and alters the properties accordingly.Stringcheckin()CallsNode.checkin()on the underlying repository node.voidcheckout()CallsNode.checkout()on the underlying repository node.voidcopy(DavResource destination, boolean shallow)Copies the underlying repository item to the indicated destination.protected DavResourcecreateResourceFromLocator(DavResourceLocator loc)Create a newDavResourcefrom the given locator.booleanexists()Returns true if there exists arepository itemwith the given resource path, false otherwise.DavResourcegetCollection()Returns the resource representing the parent item of the repository item represented by this resource.StringgetDisplayName()Retrieves the last segment of the item path (or the resource path if this resource does not exist).DavResourceFactorygetFactory()Return theDavResourceFactorythat created this resource.StringgetHref()Returns the absolute href of this resource as returned in the multistatus response body.protected static StringgetItemName(String itemPath)Retrieves the last segment of the given path and removes the index if present.DavResourceLocatorgetLocator()Returns thelocatorobject for this webdav resource, which encapsulates the information for building the complete 'href'.protected DavResourceLocatorgetLocatorFromItem(Item repositoryItem)Build a newDavResourceLocatorfrom the given repository item.protected DavResourceLocatorgetLocatorFromItemPath(String itemPath)Build aDavResourceLocatorfrom the given itemPath path.ActiveLock[]getLocks()Returns an array of all locks applied to the given resource.OptionsResponsegetOptionResponse(OptionsInfo optionsInfo)Retrieves the information requested in the OPTIONS request body and returns the corresponding values.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.QueryGrammerSetgetQueryGrammerSet()Returns the protected DAV:supported-method-set property which is defined mandatory by RTF 3253.DavResource[]getReferenceResources(DavPropertyName hrefPropertyName)Return an array ofDavResourceobjects that are referenced by the property with the specified name.ReportgetReport(ReportInfo reportInfo)Runs the report specified by the givenReportInfo.protected SessiongetRepositorySession()Shortcut forgetSession().getRepositorySession()StringgetResourcePath()Returns the path of the underlying repository item or the item to be created (PUT/MKCOL).DavSessiongetSession()Retrieve theDavSessionassociated with this resource.StringgetSupportedMethods()Return a comma separated string listing the supported method names.StringgetTransactionId()The TransactionId ornullaccording to the value of the corresponding requestheaderfield.VersionHistoryResourcegetVersionHistory()Returns theVersionHistoryassociated with the repository node.protected StringgetWorkspaceHref()Retrieve the href of the workspace the current session belongs to.voidinit(SubscriptionManager subsMgr)Initializes this resource.voidinit(TxLockManager txMgr, String transactionId)Initializes theTransactionResource.protected voidinitProperties()Fill the property set for this resource.protected voidinitPropertyNames()Property names common to all resources.protected voidinitSupportedReports()Define the set of reports supported by this resource.booleanisLockable(Type type, Scope scope)Returns true, if theSupportedLockproperty contains an entry with the given type and scope.voidlabel(LabelInfo labelInfo)Modify the labels present with the versions of this resource.MultiStatusmerge(MergeInfo mergeInfo)Merge the repository node represented by this resource according to the information present in the givenMergeInfoobject.voidmove(DavResource destination)Moves the underlying repository item to the indicated destination.protected StringnormalizeResourceHref(String href)Normalize the resourcehref.EventDiscoverypoll(String subscriptionId, long timeout)Retrieve the list of events that where recorded for the event listener with the given SubscriptionId.MultiStatussearch(SearchInfo sInfo)Runs a search with the language and query defined in theSearchInfoobject specified and returns aMultiStatusobject listing the results.Subscriptionsubscribe(SubscriptionInfo info, String subscriptionId)Subscribe this resource for event listening defined by the specified subscription info.voiduncheckout()Not implemented.voidunlock(String lockToken, TransactionInfo tInfo)Overloads theunlockmethod of theDavResourceinterface.voidunsubscribe(String subscriptionId)Unsubscribe the event listener with the given SubscriptionId.MultiStatusupdate(UpdateInfo updateInfo)Perform an update on this resource.-
Methods inherited from class org.apache.jackrabbit.webdav.jcr.DefaultItemCollection
addHrefProperty, addHrefProperty, addHrefProperty, addMember, getComplianceClass, getCreationDate, getCreatorDisplayName, getHrefProperty, getHrefProperty, getHrefProperty, getLock, getMembers, getModificationTime, hasLock, initLockSupport, isCollection, isOrderable, lock, orderMembers, refreshLock, removeMember, removeProperty, setProperty, spool, unlock
-
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, addMember, copy, exists, getCollection, getComplianceClass, getDisplayName, getFactory, getHref, getLocator, getLock, getLocks, getMembers, getModificationTime, getProperties, getPropertyNames, getResourcePath, getSession, hasLock, isCollection, isLockable, lock, move, refreshLock, removeMember, removeProperty, setProperty, spool, unlock
-
Methods inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
addWorkspace, getOptionResponse, getReferenceResources, getReport
-
-
-
-
Field Detail
-
item
protected final Item item
-
initedProps
protected boolean initedProps
-
properties
protected DavPropertySet properties
-
names
protected DavPropertyNameSet names
-
supportedLock
protected SupportedLock supportedLock
-
supportedReports
protected SupportedReportSetProperty supportedReports
-
-
Constructor Detail
-
VersionControlledItemCollection
public VersionControlledItemCollection(DavResourceLocator locator, JcrDavSession session, DavResourceFactory factory, Item item)
Create a newVersionControlledItemCollection.- Parameters:
locator-session-factory-item-
-
-
Method Detail
-
getSupportedMethods
public String getSupportedMethods()
Return a comma separated string listing the supported method names.- Specified by:
getSupportedMethodsin interfaceDavResource- Overrides:
getSupportedMethodsin classDefaultItemCollection- Returns:
- the supported method names.
- See Also:
DavResource.getSupportedMethods()
-
getProperty
public DavProperty<?> getProperty(DavPropertyName name)
Description copied from interface:DavResourceReturn the webdav property with the specified name.- Specified by:
getPropertyin interfaceDavResource- Overrides:
getPropertyin classDefaultItemCollection- Parameters:
name- name of the webdav property- Returns:
- the
DavPropertywith the given name ornullif the property does not exist. - See Also:
DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
alterProperties
public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList) throws DavException
Description copied from class:DefaultItemCollectionLoops over the givenLists and alters the properties accordingly. Changes are persisted at the end according to the rules defined with theAbstractItemResource.complete()method.Please note: since there is only a single property (
ItemResourceConstants.JCR_MIXINNODETYPESthat can be set or removed with PROPPATCH, this method either succeeds or throws an exception, even if this violates RFC 2518. Thus no property specific multistatus will be created in case of an error.- Specified by:
alterPropertiesin interfaceDavResource- Overrides:
alterPropertiesin classDefaultItemCollection- Parameters:
changeList-- 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- See Also:
for additional description of non-compliant behaviour.
-
addVersionControl
public void addVersionControl() throws DavExceptionAdds version control to this resource. If the resource is already under version control, this method has no effect.- Specified by:
addVersionControlin interfaceVersionableResource- Throws:
DavException- if this resource does not exist yet or if an error occurs while making the underlying node versionable.- See Also:
VersionableResource.addVersionControl()
-
checkin
public String checkin() throws DavException
CallsNode.checkin()on the underlying repository node.- Specified by:
checkinin interfaceVersionControlledResource- Returns:
- String representing the location of the version created by the checkin.
- Throws:
DavException- See Also:
VersionControlledResource.checkin()
-
checkout
public void checkout() throws DavExceptionCallsNode.checkout()on the underlying repository node.- Specified by:
checkoutin interfaceVersionControlledResource- Throws:
DavException- See Also:
VersionControlledResource.checkout()
-
uncheckout
public void uncheckout() throws DavExceptionNot implemented. Always throws aDavExceptionwith error codeHttpServletResponse.SC_NOT_IMPLEMENTED.- Specified by:
uncheckoutin interfaceVersionControlledResource- Throws:
DavException- See Also:
VersionControlledResource.uncheckout()
-
update
public MultiStatus update(UpdateInfo updateInfo) throws DavException
Perform an update on this resource. Depending on the format of theupdateInfothis is translated to one of the following methods defined by the JCR API:Node.restore(javax.jcr.version.Version, boolean)Node.restore(javax.jcr.version.Version, String, boolean)Node.restoreByLabel(String, boolean)Node.update(String)
Limitation: note that the
MultiStatusreturned by this method will not list any nodes that have been removed due to an Uuid conflict.- Specified by:
updatein interfaceVersionControlledResource- Parameters:
updateInfo-- Returns:
- Throws:
DavException- See Also:
VersionControlledResource.update(org.apache.jackrabbit.webdav.version.UpdateInfo)
-
merge
public MultiStatus merge(MergeInfo mergeInfo) throws DavException
Merge the repository node represented by this resource according to the information present in the givenMergeInfoobject.- Specified by:
mergein interfaceVersionControlledResource- Parameters:
mergeInfo-- Returns:
MultiStatusrecording all repository items modified by this merge call as well as the resources that a client must modify to complete the merge (see RFC 3253)- Throws:
DavException- See Also:
VersionControlledResource.merge(org.apache.jackrabbit.webdav.version.MergeInfo),Node.merge(String, boolean)
-
label
public void label(LabelInfo labelInfo) throws DavException
Modify the labels present with the versions of this resource.- Specified by:
labelin interfaceVersionControlledResource- Parameters:
labelInfo-- Throws:
DavException- See Also:
VersionHistory.addVersionLabel(String, String, boolean),VersionHistory.removeVersionLabel(String)
-
getVersionHistory
public VersionHistoryResource getVersionHistory() throws DavException
Returns theVersionHistoryassociated with the repository node. If the node is not versionable an exception is thrown.- Specified by:
getVersionHistoryin interfaceVersionControlledResource- Returns:
- the
VersionHistoryResourceassociated with this resource. - Throws:
DavException- See Also:
VersionControlledResource.getVersionHistory(),Node.getVersionHistory()
-
initSupportedReports
protected void initSupportedReports()
Define the set of reports supported by this resource.- Overrides:
initSupportedReportsin classDefaultItemCollection- See Also:
SupportedReportSetProperty
-
initPropertyNames
protected void initPropertyNames()
Property names common to all resources.- Overrides:
initPropertyNamesin classDefaultItemCollection
-
initProperties
protected void initProperties()
Fill the property set for this resource.- Overrides:
initPropertiesin classDefaultItemCollection
-
exists
public boolean exists()
Returns true if there exists arepository itemwith the given resource path, false otherwise.- Specified by:
existsin interfaceDavResource- Returns:
- true, if the resource represents an existing repository item.
- See Also:
DavResource.exists()
-
getDisplayName
public String getDisplayName()
Retrieves the last segment of the item path (or the resource path if this resource does not exist). An item path is in addition first translated to the corresponding resource path.
NOTE: the display name is not equivalent toitem namewhich is exposed with the{http://www.day.com/jcr/webdav/1.0}nameproperty.- Specified by:
getDisplayNamein interfaceDavResource- Returns:
- display name.
- See Also:
DavResource.getDisplayName()
-
getCollection
public DavResource getCollection()
Returns the resource representing the parent item of the repository item represented by this resource. If this resoure represents the root item aRootCollectionis returned.- Specified by:
getCollectionin interfaceDavResource- Returns:
- the collection this resource is internal member of. Except for the repository root, the returned collection always represent the parent repository node.
- See Also:
DavResource.getCollection()
-
move
public void move(DavResource destination) throws DavException
Moves the underlying repository item to the indicated destination.- Specified by:
movein interfaceDavResource- Parameters:
destination-- Throws:
DavException- See Also:
DavResource.move(DavResource),Session.move(String, String)
-
copy
public void copy(DavResource destination, boolean shallow) throws DavException
Copies the underlying repository item to the indicated destination. If the locator of the specified destination resource indicates a different workspace,Workspace.copy(String, String, String)is used to perform the copy operation,Workspace.copy(String, String)otherwise.Note, that this implementation does not support shallow copy.
- Specified by:
copyin interfaceDavResource- Parameters:
destination-shallow-- Throws:
DavException- See Also:
DavResource.copy(DavResource, boolean),Workspace.copy(String, String),Workspace.copy(String, String, String)
-
init
public void init(SubscriptionManager subsMgr)
Description copied from interface:ObservationResourceInitializes this resource.- Specified by:
initin interfaceObservationResource- Parameters:
subsMgr- subscription manager object- See Also:
ObservationResource.init(SubscriptionManager)
-
subscribe
public Subscription subscribe(SubscriptionInfo info, String subscriptionId) throws DavException
Description copied from interface:ObservationResourceSubscribe this resource for event listening defined by the specified subscription info. A subscriptionId may be specified in case an existing subscription should be modified.- Specified by:
subscribein interfaceObservationResource- Parameters:
info-SubscriptionInfoobject as defined by the request body and headers.subscriptionId- ornullif theSubscriptionIdheader is missing.- Returns:
Subscriptionobject in case the subscription was successful.- Throws:
DavException- See Also:
ObservationResource.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String),SubscriptionManager.subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo, String, org.apache.jackrabbit.webdav.observation.ObservationResource)
-
unsubscribe
public void unsubscribe(String subscriptionId) throws DavException
Description copied from interface:ObservationResourceUnsubscribe the event listener with the given SubscriptionId.- Specified by:
unsubscribein interfaceObservationResource- Parameters:
subscriptionId- as present in theSubscriptionIdheader.- Throws:
DavException- See Also:
ObservationResource.unsubscribe(String),SubscriptionManager.unsubscribe(String, org.apache.jackrabbit.webdav.observation.ObservationResource)
-
poll
public EventDiscovery poll(String subscriptionId, long timeout) throws DavException
Description copied from interface:ObservationResourceRetrieve the list of events that where recorded for the event listener with the given SubscriptionId.- Specified by:
pollin interfaceObservationResource- Parameters:
subscriptionId- as present in theSubscriptionIdheader.timeout- as present in theObservationConstants.HEADER_POLL_TIMEOUTheader or 0 (zero) if none is present.- Returns:
EventDiscoveryobject- Throws:
DavException- See Also:
ObservationResource.poll(String, long),SubscriptionManager.poll(String, long, org.apache.jackrabbit.webdav.observation.ObservationResource)
-
getWorkspaceHref
protected String getWorkspaceHref()
Retrieve the href of the workspace the current session belongs to.- Returns:
- href of the workspace or
nullif this resource does not represent a repository item. - See Also:
AbstractResource.getWorkspaceHref()
-
getItemName
protected static String getItemName(String itemPath)
Retrieves the last segment of the given path and removes the index if present.- Parameters:
itemPath-- Returns:
- valid jcr item name
-
getLocator
public DavResourceLocator getLocator()
Description copied from interface:DavResourceReturns thelocatorobject for this webdav resource, which encapsulates the information for building the complete 'href'.- Specified by:
getLocatorin 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 itemnullis returned.- Specified by:
getResourcePathin interfaceDavResource- Returns:
- path of the underlying repository item.
- See Also:
DavResource.getResourcePath(),DavResourceLocator.getResourcePath()
-
getHref
public String getHref()
Description copied from interface:DavResourceReturns the absolute href of this resource as returned in the multistatus response body.- Specified by:
getHrefin interfaceDavResource- Returns:
- href
- See Also:
DavResource.getHref(),DavResourceLocator.getHref(boolean)
-
getPropertyNames
public DavPropertyName[] getPropertyNames()
Description copied from interface:DavResourceReturns an array of allproperty namesavailable on this resource.- Specified by:
getPropertyNamesin interfaceDavResource- Returns:
- an array of property names.
- See Also:
DavResource.getPropertyNames()
-
getProperties
public DavPropertySet getProperties()
Description copied from interface:DavResourceReturns 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().- Specified by:
getPropertiesin interfaceDavResource- Returns:
- a
DavPropertySetcontaining at least all properties of this resource that are exposed in 'allprop' PROPFIND request. - See Also:
DavResource.getProperties()
-
isLockable
public boolean isLockable(Type type, Scope scope)
Returns true, if theSupportedLockproperty contains an entry with the given type and scope. By default resources allow fortransactionlock only.- Specified by:
isLockablein 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)
-
getLocks
public ActiveLock[] getLocks()
Description copied from interface:DavResourceReturns an array of all locks applied to the given resource.- Specified by:
getLocksin interfaceDavResource- Returns:
- array of locks. The array is empty if there are no locks applied to this resource.
- See Also:
todo improve....
-
addLockManager
public void addLockManager(LockManager lockMgr)
Description copied from interface:DavResourceAdd an externalLockManagerto this resource. This method may throwUnsupportedOperationExceptionif the resource does handle locking itself.- Specified by:
addLockManagerin interfaceDavResource- See Also:
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)
-
getFactory
public DavResourceFactory getFactory()
Description copied from interface:DavResourceReturn theDavResourceFactorythat created this resource.- Specified by:
getFactoryin interfaceDavResource- Returns:
- the factory that created this resource.
- See Also:
DavResource.getFactory()
-
getSession
public DavSession getSession()
Description copied from interface:DavResourceRetrieve theDavSessionassociated with this resource.- Specified by:
getSessionin 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:TransactionResourceInitializes theTransactionResource.- Specified by:
initin interfaceTransactionResource- See Also:
TransactionResource.init(TxLockManager, String)
-
unlock
public void unlock(String lockToken, TransactionInfo tInfo) throws DavException
Description copied from interface:TransactionResourceOverloads theunlockmethod of theDavResourceinterface.- Specified by:
unlockin 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:TransactionResourceThe TransactionId ornullaccording to the value of the corresponding requestheaderfield.- Specified by:
getTransactionIdin interfaceTransactionResource- Returns:
- TransactionId header or
null - See Also:
TransactionResource.getTransactionId()
-
getOptionResponse
public OptionsResponse getOptionResponse(OptionsInfo optionsInfo)
Description copied from interface:DeltaVResourceRetrieves the information requested in the OPTIONS request body and returns the corresponding values.- Specified by:
getOptionResponsein 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:DeltaVResourceRuns the report specified by the givenReportInfo.- Specified by:
getReportin 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. CallingaddWorkspaceon this resource will always fail.- Specified by:
addWorkspacein 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 ofDavResourceobjects that are referenced by the property with the specified name.- Specified by:
getReferenceResourcesin interfaceDeltaVResource- Parameters:
hrefPropertyName-- Returns:
- array of
DavResources - Throws:
DavException- See Also:
DeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
getQueryGrammerSet
public QueryGrammerSet getQueryGrammerSet()
Description copied from interface:SearchResourceReturns 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:
getQueryGrammerSetin interfaceSearchResource- Returns:
- See Also:
SearchResource.getQueryGrammerSet()
-
search
public MultiStatus search(SearchInfo sInfo) throws DavException
Description copied from interface:SearchResourceRuns a search with the language and query defined in theSearchInfoobject specified and returns aMultiStatusobject listing the results.- Specified by:
searchin 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 newDavResourcefrom the given locator.- Parameters:
loc-- Returns:
- new
DavResource - Throws:
DavException
-
getLocatorFromItemPath
protected DavResourceLocator getLocatorFromItemPath(String itemPath)
Build aDavResourceLocatorfrom 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 newDavResourceLocatorfrom 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.
-
-