org.apache.jackrabbit.webdav.jcr
Class DefaultItemCollection

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.jcr.AbstractResource
      extended byorg.apache.jackrabbit.webdav.jcr.AbstractItemResource
          extended byorg.apache.jackrabbit.webdav.jcr.DefaultItemCollection
All Implemented Interfaces:
org.apache.jackrabbit.webdav.DavResource, org.apache.jackrabbit.webdav.version.DeltaVResource, ItemResourceConstants, org.apache.jackrabbit.webdav.observation.ObservationResource, org.apache.jackrabbit.webdav.ordering.OrderingResource, org.apache.jackrabbit.webdav.search.SearchResource, org.apache.jackrabbit.webdav.transaction.TransactionResource
Direct Known Subclasses:
VersionControlledItemCollection, VersionHistoryItemCollection, VersionItemCollection

public class DefaultItemCollection
extends org.apache.jackrabbit.webdav.jcr.AbstractItemResource
implements org.apache.jackrabbit.webdav.ordering.OrderingResource

DefaultItemCollection represents a JCR node item.


Field Summary
protected  boolean initedProps
           
protected  Item item
           
protected  org.apache.jackrabbit.webdav.property.DavPropertySet properties
           
protected  org.apache.jackrabbit.webdav.lock.SupportedLock supportedLock
           
protected  org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty supportedReports
           
 
Fields inherited from interface org.apache.jackrabbit.webdav.ordering.OrderingResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.jcr.ItemResourceConstants
ATTR_VALUE_TYPE, COMPLIANCE_CLASS, EXCLUSIVE_SESSION, JCR_DEFINITION, JCR_DEPTH, JCR_INDEX, JCR_ISMODIFIED, JCR_ISNEW, JCR_LENGTH, JCR_LENGTHS, JCR_MIXINNODETYPES, JCR_NAME, JCR_NAMESPACES, JCR_PARENT, JCR_PATH, JCR_PRIMARYITEM, JCR_PRIMARYNODETYPE, JCR_REFERENCES, JCR_TYPE, JCR_UUID, JCR_VALUE, JCR_VALUES, JCR_VERSIONABLEUUID, METHODS, NAMESPACE, ROOT_ITEM_PATH, VERSIONSTORAGE_PATH, XML_DESCRIPTOR, XML_DESCRIPTORKEY, XML_DESCRIPTORVALUE, XML_EXCLUSIVE_SESSION_SCOPED, XML_LENGTH, XML_NAMESPACE, XML_PREFIX, XML_PRIMARYNODETYPE, XML_RELPATH, XML_REMOVEEXISTING, XML_URI, XML_VALUE
 
Fields inherited from interface org.apache.jackrabbit.webdav.observation.ObservationResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionResource
COMPLIANCE_CLASS, METHODS
 
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVResource
COMPLIANCE_CLASS, METHODS, METHODS_INCL_MKWORKSPACE
 
Fields inherited from interface org.apache.jackrabbit.webdav.search.SearchResource
COMPLIANCE_CLASS, METHODS
 
Constructor Summary
protected DefaultItemCollection(org.apache.jackrabbit.webdav.DavResourceLocator locator, JcrDavSession session, org.apache.jackrabbit.webdav.DavResourceFactory factory, Item item)
          Create a new DefaultItemCollection.
 
Method Summary
protected  void addHrefProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name, Item[] values, boolean isProtected)
          Add a HrefProperty with the specified property name and values.
protected  void addHrefProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name, Iterator itemIterator, boolean isProtected)
          Add a new href property to the property set, where all items present in the specifed iterator are referenced in the resulting property.
 void addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr)
           
 void addMember(org.apache.jackrabbit.webdav.DavResource resource, org.apache.jackrabbit.webdav.io.InputContext inputContext)
          If the specified resource represents a collection, a new node is added to the item represented by this resource.
 void addWorkspace(org.apache.jackrabbit.webdav.DavResource workspace)
          The JCR api does not provide methods to create new workspaces.
 org.apache.jackrabbit.webdav.MultiStatusResponse alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet setProperties, org.apache.jackrabbit.webdav.property.DavPropertyNameSet removePropertyNames)
          Loops over the given Sets and alters the properties accordingly.
 void copy(org.apache.jackrabbit.webdav.DavResource destination, boolean shallow)
          Copies the underlying repository item to the indicated destination.
protected  org.apache.jackrabbit.webdav.DavResource createResourceFromLocator(org.apache.jackrabbit.webdav.DavResourceLocator loc)
          Create a new DavResource from the given locator.
 boolean exists()
          Returns true if there exists a repository item with the given resource path, false otherwise.
 org.apache.jackrabbit.webdav.DavResource getCollection()
          Returns the resource representing the parent item of the repository item represented by this resource.
 String getComplianceClass()
           
 String getDisplayName()
          Retrieves the last segment of the item path (or the resource path if this resource does not exist).
 org.apache.jackrabbit.webdav.DavResourceFactory getFactory()
           
 String getHref()
           
protected static String getItemName(String itemPath)
          Retrieves the last segment of the given path and removes the index if present.
 org.apache.jackrabbit.webdav.DavResourceLocator getLocator()
           
protected  org.apache.jackrabbit.webdav.DavResourceLocator getLocatorFromItem(Item repositoryItem)
          Build a new DavResourceLocator from the given repository item.
protected  org.apache.jackrabbit.webdav.DavResourceLocator getLocatorFromItemPath(String itemPath)
          Build a DavResourceLocator from the given itemPath path.
 org.apache.jackrabbit.webdav.lock.ActiveLock getLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
          Retrieve the lock with the specified type and scope.
 org.apache.jackrabbit.webdav.lock.ActiveLock[] getLocks()
           
 org.apache.jackrabbit.webdav.DavResourceIterator getMembers()
           
 long getModificationTime()
           
 org.apache.jackrabbit.webdav.version.OptionsResponse getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo optionsInfo)
           
 org.apache.jackrabbit.webdav.property.DavPropertySet getProperties()
           
 org.apache.jackrabbit.webdav.property.DavProperty getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name)
           
 org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()
           
 org.apache.jackrabbit.webdav.search.QueryGrammerSet getQueryGrammerSet()
           
 org.apache.jackrabbit.webdav.DavResource[] getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName hrefPropertyName)
          Return an array of DavResource objects that are referenced by the property with the specified name.
 org.apache.jackrabbit.webdav.version.report.Report getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo reportInfo)
           
protected  Session getRepositorySession()
          Shortcut for getSession().getRepositorySession()
 String getResourcePath()
          Returns the path of the underlying repository item or the item to be created (PUT/MKCOL).
 org.apache.jackrabbit.webdav.DavSession getSession()
           
 InputStream getStream()
          Returns an InputStream to the content of this collection.
 String getSupportedMethods()
           
 String getTransactionId()
           
protected  String getWorkspaceHref()
          Retrieve the href of the workspace the current session belongs to.
 boolean hasLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
          Returns true if this resource has a lock applied with the given type and scope.
 void init(org.apache.jackrabbit.webdav.observation.SubscriptionManager subsMgr)
           
 void init(org.apache.jackrabbit.webdav.transaction.TxLockManager txMgr, String transactionId)
           
protected  void initLockSupport()
          Extend the general AbstractResource.supportedLock field by lock entries specific for this resource: write locks (exclusive or exclusive session-scoped) in case the underlying node has the node type mix:lockable.
protected  void initProperties()
          Fill the property set for this resource.
protected  void initSupportedReports()
          Defines the additional reports supported by this resource (reports specific for resources representing a repository node): export view report locate corresponding node report
 boolean isCollection()
          Always returns true
 boolean isLockable(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
          Returns true, if the SupportedLock property contains an entry with the given type and scope.
 boolean isOrderable()
          Returns true if this resource exists and the nodetype defining the underlying repository node allow to reorder this nodes children.
 org.apache.jackrabbit.webdav.lock.ActiveLock lock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo)
          Creates a lock on this resource by locking the underlying node.
 void move(org.apache.jackrabbit.webdav.DavResource destination)
          Moves the underlying repository item to the indicated destination.
 void orderMembers(org.apache.jackrabbit.webdav.ordering.OrderPatch orderPatch)
          Reorder the child nodes of the repository item represented by this resource as indicated by the specified OrderPatch object.
 org.apache.jackrabbit.webdav.observation.EventDiscovery poll(String subscriptionId)
           
 org.apache.jackrabbit.webdav.lock.ActiveLock refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo, String lockToken)
          Refreshes the lock on this resource.
 void removeMember(org.apache.jackrabbit.webdav.DavResource member)
          Removes the repository item represented by the specified member resource.
 void removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName propertyName)
          This implementation of the DavResource does only allow to remove the mixinnodetypes property.
 org.apache.jackrabbit.webdav.MultiStatus search(org.apache.jackrabbit.webdav.search.SearchInfo sInfo)
           
 void setProperty(org.apache.jackrabbit.webdav.property.DavProperty property)
          This implementation of the DavResource does only allow to set the mixinnodetypes property.
 void spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext)
           
 org.apache.jackrabbit.webdav.observation.Subscription subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info, String subscriptionId)
           
 void unlock(String lockToken)
          Remove the write lock from this resource by unlocking the underlying node.
 void unlock(String lockToken, org.apache.jackrabbit.webdav.transaction.TransactionInfo tInfo)
           
 void unsubscribe(String subscriptionId)
           
 
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, alterProperties, copy, exists, getCollection, getDisplayName, getFactory, getHref, getLocator, getLocks, getModificationTime, getProperties, getProperty, getPropertyNames, getResourcePath, getSession, isLockable, move, spool
 

Field Detail

item

protected final Item item

initedProps

protected boolean initedProps

properties

protected org.apache.jackrabbit.webdav.property.DavPropertySet properties

supportedLock

protected org.apache.jackrabbit.webdav.lock.SupportedLock supportedLock

supportedReports

protected org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty supportedReports
Constructor Detail

DefaultItemCollection

protected DefaultItemCollection(org.apache.jackrabbit.webdav.DavResourceLocator locator,
                                JcrDavSession session,
                                org.apache.jackrabbit.webdav.DavResourceFactory factory,
                                Item item)
Create a new DefaultItemCollection.

Parameters:
locator -
session -
Method Detail

getComplianceClass

public String getComplianceClass()
Specified by:
getComplianceClass in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getComplianceClass()

getSupportedMethods

public String getSupportedMethods()
Specified by:
getSupportedMethods in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getSupportedMethods()

isCollection

public boolean isCollection()
Always returns true

Specified by:
isCollection in interface org.apache.jackrabbit.webdav.DavResource
Returns:
true
See Also:
DavResource.isCollection()

getStream

public InputStream getStream()
Returns an InputStream to the content of this collection.

Returns:
Always returns null

setProperty

public void setProperty(org.apache.jackrabbit.webdav.property.DavProperty property)
                 throws org.apache.jackrabbit.webdav.DavException
This implementation of the DavResource does only allow to set the mixinnodetypes property. Please note that the existing list of mixin nodetypes will be completely replaced.
In order to add / set any other repository property on the underlying Node use addMember(DavResource) or addMember(DavResource, InputStream) or modify the value of the corresponding resource.

Specified by:
setProperty in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
property -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty), ItemResourceConstants.JCR_MIXINNODETYPES

removeProperty

public void removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName propertyName)
                    throws org.apache.jackrabbit.webdav.DavException
This implementation of the DavResource does only allow to remove the mixinnodetypes property.

Specified by:
removeProperty in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
propertyName -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName), ItemResourceConstants.JCR_MIXINNODETYPES

alterProperties

public org.apache.jackrabbit.webdav.MultiStatusResponse alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet setProperties,
                                                                        org.apache.jackrabbit.webdav.property.DavPropertyNameSet removePropertyNames)
                                                                 throws org.apache.jackrabbit.webdav.DavException
Loops over the given Sets and alters the properties accordingly. Changes are persisted at the end according to the rules defined with the #complete() method.

Please note: since there is only a single property (ItemResourceConstants.JCR_MIXINNODETYPES that 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:
alterProperties in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
setProperties -
removePropertyNames -
Returns:
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet, org.apache.jackrabbit.webdav.property.DavPropertyNameSet)

addMember

public void addMember(org.apache.jackrabbit.webdav.DavResource resource,
                      org.apache.jackrabbit.webdav.io.InputContext inputContext)
               throws org.apache.jackrabbit.webdav.DavException
If the specified resource represents a collection, a new node is added to the item represented by this resource. If an input stream is specified together with a collection resource Session.importXML(String, java.io.InputStream, int) is called instead and this resource path is used as parentAbsPath argument.

However, if the specified resource is not of resource type collection a new Property is set or an existing one is changed by modifying its value.
NOTE: with the current implementation it is not possible to create or modify multivalue JCR properties.
NOTE: if the JCR property represented by the specified resource has an undefined resource type, its value will be changed/set to type binary.

Specified by:
addMember in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
resource -
inputContext -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.addMember(org.apache.jackrabbit.webdav.DavResource, InputContext), Node.addNode(String), Node.setProperty(String, java.io.InputStream)

getMembers

public org.apache.jackrabbit.webdav.DavResourceIterator getMembers()
Specified by:
getMembers in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getMembers()

removeMember

public void removeMember(org.apache.jackrabbit.webdav.DavResource member)
                  throws org.apache.jackrabbit.webdav.DavException
Removes the repository item represented by the specified member resource.

Specified by:
removeMember in interface org.apache.jackrabbit.webdav.DavResource
Throws:
org.apache.jackrabbit.webdav.DavException - if this resource does not exist or if an error occurs while deleting the underlying item.
See Also:
DavResource.removeMember(DavResource), Item.remove()

hasLock

public boolean hasLock(org.apache.jackrabbit.webdav.lock.Type type,
                       org.apache.jackrabbit.webdav.lock.Scope scope)
Description copied from class: org.apache.jackrabbit.webdav.jcr.AbstractResource
Returns true if this resource has a lock applied with the given type and scope.

Specified by:
hasLock in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
type -
scope -
Returns:
true if a lock with the specified type and scope is present on this resource, false otherwise. If retrieving the corresponding information fails, false is returned.
See Also:
DavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)

getLock

public org.apache.jackrabbit.webdav.lock.ActiveLock getLock(org.apache.jackrabbit.webdav.lock.Type type,
                                                            org.apache.jackrabbit.webdav.lock.Scope scope)
Retrieve the lock with the specified type and scope.

Specified by:
getLock in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
type -
scope -
Returns:
lock with the specified type and scope is present on this resource or null. NOTE: If retrieving the write lock present on the underlying repository item fails, null is return.
See Also:
DavResource.getLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope), for the write locks.

lock

public org.apache.jackrabbit.webdav.lock.ActiveLock lock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo)
                                                  throws org.apache.jackrabbit.webdav.DavException
Creates a lock on this resource by locking the underlying node. Except for the LockInfo.isDeep() } all information included in the LockInfo object is ignored. Lock timeout is defined by JCR implementation.

Specified by:
lock in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
reqLockInfo -
Returns:
lock object representing the lock created on this resource.
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.lock(org.apache.jackrabbit.webdav.lock.LockInfo), Node.lock(boolean, boolean)

refreshLock

public org.apache.jackrabbit.webdav.lock.ActiveLock refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo,
                                                                String lockToken)
                                                         throws org.apache.jackrabbit.webdav.DavException
Refreshes the lock on this resource. With this implementation the lock present on the underlying node is refreshed. The timeout indicated by the LockInfo object is ignored.

Specified by:
refreshLock in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
reqLockInfo - LockInfo as build from the request.
lockToken -
Returns:
the updated lock info object.
Throws:
org.apache.jackrabbit.webdav.DavException - in case the lock could not be refreshed.
See Also:
DavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String), Lock.refresh()

unlock

public void unlock(String lockToken)
            throws org.apache.jackrabbit.webdav.DavException
Remove the write lock from this resource by unlocking the underlying node.

Specified by:
unlock in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
lockToken -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.unlock(String), Node.unlock()

isOrderable

public boolean isOrderable()
Returns true if this resource exists and the nodetype defining the underlying repository node allow to reorder this nodes children.

Specified by:
isOrderable in interface org.apache.jackrabbit.webdav.ordering.OrderingResource
Returns:
true if orderMembers(OrderPatch) can be called on this resource.
See Also:
OrderingResource.isOrderable(), NodeType.hasOrderableChildNodes()

orderMembers

public void orderMembers(org.apache.jackrabbit.webdav.ordering.OrderPatch orderPatch)
                  throws org.apache.jackrabbit.webdav.DavException
Reorder the child nodes of the repository item represented by this resource as indicated by the specified OrderPatch object.

Specified by:
orderMembers in interface org.apache.jackrabbit.webdav.ordering.OrderingResource
Parameters:
orderPatch -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
OrderingResource.orderMembers(org.apache.jackrabbit.webdav.ordering.OrderPatch), Node.orderBefore(String, String)

initLockSupport

protected void initLockSupport()
Extend the general AbstractResource.supportedLock field by lock entries specific for this resource: write locks (exclusive or exclusive session-scoped) in case the underlying node has the node type mix:lockable.

See Also:
JcrConstants.MIX_LOCKABLE

initSupportedReports

protected void initSupportedReports()
Defines the additional reports supported by this resource (reports specific for resources representing a repository node):

See Also:
SupportedReportSetProperty

initProperties

protected void initProperties()
Fill the property set for this resource.


addHrefProperty

protected void addHrefProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name,
                               Item[] values,
                               boolean isProtected)
Add a HrefProperty with the specified property name and values. Each item present in the specified values array is referenced in the resulting property.

Parameters:
name -
values -
isProtected -

addHrefProperty

protected void addHrefProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name,
                               Iterator itemIterator,
                               boolean isProtected)
Add a new href property to the property set, where all items present in the specifed iterator are referenced in the resulting property.

Parameters:
name -
itemIterator -
isProtected -
See Also:
addHrefProperty(DavPropertyName, Item[], boolean)

exists

public boolean exists()
Returns true if there exists a repository item with the given resource path, false otherwise.

Specified by:
exists in interface org.apache.jackrabbit.webdav.DavResource
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 displayname is not equivalent to item name which is exposed with the {http://www.day.com/jcr/webdav/1.0}name property.

Specified by:
getDisplayName in interface org.apache.jackrabbit.webdav.DavResource
See Also:
)

getCollection

public org.apache.jackrabbit.webdav.DavResource getCollection()
Returns the resource representing the parent item of the repository item represented by this resource. If this resoure represents the root item a RootCollection is returned.

Specified by:
getCollection in interface org.apache.jackrabbit.webdav.DavResource
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(org.apache.jackrabbit.webdav.DavResource destination)
          throws org.apache.jackrabbit.webdav.DavException
Moves the underlying repository item to the indicated destination.

Specified by:
move in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
destination -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.move(DavResource), Session.move(String, String)

copy

public void copy(org.apache.jackrabbit.webdav.DavResource destination,
                 boolean shallow)
          throws org.apache.jackrabbit.webdav.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:
copy in interface org.apache.jackrabbit.webdav.DavResource
Parameters:
destination -
shallow -
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DavResource.copy(DavResource, boolean), Workspace.copy(String, String), Workspace.copy(String, String, String)

getWorkspaceHref

protected String getWorkspaceHref()
Description copied from class: org.apache.jackrabbit.webdav.jcr.AbstractResource
Retrieve the href of the workspace the current session belongs to.

Returns:
href of the workspace or null if 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 org.apache.jackrabbit.webdav.DavResourceLocator getLocator()
Specified by:
getLocator in interface org.apache.jackrabbit.webdav.DavResource
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 item null is returned.

Specified by:
getResourcePath in interface org.apache.jackrabbit.webdav.DavResource
Returns:
path of the underlying repository item.
See Also:
DavResource.getResourcePath(), DavResourceLocator.getResourcePath()

getHref

public String getHref()
Specified by:
getHref in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getHref(), DavResourceLocator.getHref(boolean)

getModificationTime

public long getModificationTime()
Specified by:
getModificationTime in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getModificationTime()

spool

public void spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext)
           throws IOException
Specified by:
spool in interface org.apache.jackrabbit.webdav.DavResource
Throws:
IOException
See Also:
DavResource.spool(OutputContext)

getPropertyNames

public org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()
Specified by:
getPropertyNames in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getPropertyNames()

getProperty

public org.apache.jackrabbit.webdav.property.DavProperty getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name)
Specified by:
getProperty in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)

getProperties

public org.apache.jackrabbit.webdav.property.DavPropertySet getProperties()
Specified by:
getProperties in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getProperties()

isLockable

public boolean isLockable(org.apache.jackrabbit.webdav.lock.Type type,
                          org.apache.jackrabbit.webdav.lock.Scope scope)
Returns true, if the SupportedLock property contains an entry with the given type and scope. By default resources allow for transaction lock only.

Specified by:
isLockable in interface org.apache.jackrabbit.webdav.DavResource
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 org.apache.jackrabbit.webdav.lock.ActiveLock[] getLocks()
Specified by:
getLocks in interface org.apache.jackrabbit.webdav.DavResource
See Also:
todo improve....

addLockManager

public void addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr)
Specified by:
addLockManager in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)

getFactory

public org.apache.jackrabbit.webdav.DavResourceFactory getFactory()
Specified by:
getFactory in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getFactory()

getSession

public org.apache.jackrabbit.webdav.DavSession getSession()
Specified by:
getSession in interface org.apache.jackrabbit.webdav.DavResource
See Also:
DavResource.getSession(), DavResource.getSession()

init

public void init(org.apache.jackrabbit.webdav.observation.SubscriptionManager subsMgr)
Specified by:
init in interface org.apache.jackrabbit.webdav.observation.ObservationResource
See Also:
ObservationResource.init(SubscriptionManager)

subscribe

public org.apache.jackrabbit.webdav.observation.Subscription subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info,
                                                                       String subscriptionId)
                                                                throws org.apache.jackrabbit.webdav.DavException
Specified by:
subscribe in interface org.apache.jackrabbit.webdav.observation.ObservationResource
Throws:
org.apache.jackrabbit.webdav.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 org.apache.jackrabbit.webdav.DavException
Specified by:
unsubscribe in interface org.apache.jackrabbit.webdav.observation.ObservationResource
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
ObservationResource.unsubscribe(String), SubscriptionManager.unsubscribe(String, org.apache.jackrabbit.webdav.observation.ObservationResource)

poll

public org.apache.jackrabbit.webdav.observation.EventDiscovery poll(String subscriptionId)
                                                             throws org.apache.jackrabbit.webdav.DavException
Specified by:
poll in interface org.apache.jackrabbit.webdav.observation.ObservationResource
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
ObservationResource.poll(String), SubscriptionManager.poll(String, org.apache.jackrabbit.webdav.observation.ObservationResource)

init

public void init(org.apache.jackrabbit.webdav.transaction.TxLockManager txMgr,
                 String transactionId)
Specified by:
init in interface org.apache.jackrabbit.webdav.transaction.TransactionResource
See Also:
TransactionResource.init(TxLockManager, String)

unlock

public void unlock(String lockToken,
                   org.apache.jackrabbit.webdav.transaction.TransactionInfo tInfo)
            throws org.apache.jackrabbit.webdav.DavException
Specified by:
unlock in interface org.apache.jackrabbit.webdav.transaction.TransactionResource
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
TransactionResource.unlock(String, org.apache.jackrabbit.webdav.transaction.TransactionInfo)

getTransactionId

public String getTransactionId()
Specified by:
getTransactionId in interface org.apache.jackrabbit.webdav.transaction.TransactionResource
See Also:
TransactionResource.getTransactionId()

getOptionResponse

public org.apache.jackrabbit.webdav.version.OptionsResponse getOptionResponse(org.apache.jackrabbit.webdav.version.OptionsInfo optionsInfo)
Specified by:
getOptionResponse in interface org.apache.jackrabbit.webdav.version.DeltaVResource
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 org.apache.jackrabbit.webdav.version.report.Report getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo reportInfo)
                                                             throws org.apache.jackrabbit.webdav.DavException
Specified by:
getReport in interface org.apache.jackrabbit.webdav.version.DeltaVResource
Parameters:
reportInfo -
Returns:
the requested report
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DeltaVResource.getReport(org.apache.jackrabbit.webdav.version.report.ReportInfo)

addWorkspace

public void addWorkspace(org.apache.jackrabbit.webdav.DavResource workspace)
                  throws org.apache.jackrabbit.webdav.DavException
The JCR api does not provide methods to create new workspaces. Calling addWorkspace on this resource will always fail.

Specified by:
addWorkspace in interface org.apache.jackrabbit.webdav.version.DeltaVResource
Parameters:
workspace -
Throws:
org.apache.jackrabbit.webdav.DavException - Always throws.
See Also:
DeltaVResource.addWorkspace(org.apache.jackrabbit.webdav.DavResource)

getReferenceResources

public org.apache.jackrabbit.webdav.DavResource[] getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName hrefPropertyName)
                                                                 throws org.apache.jackrabbit.webdav.DavException
Return an array of DavResource objects that are referenced by the property with the specified name.

Specified by:
getReferenceResources in interface org.apache.jackrabbit.webdav.version.DeltaVResource
Parameters:
hrefPropertyName -
Returns:
array of DavResources
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
DeltaVResource.getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)

getQueryGrammerSet

public org.apache.jackrabbit.webdav.search.QueryGrammerSet getQueryGrammerSet()
Specified by:
getQueryGrammerSet in interface org.apache.jackrabbit.webdav.search.SearchResource
Returns:
See Also:
SearchResource.getQueryGrammerSet()

search

public org.apache.jackrabbit.webdav.MultiStatus search(org.apache.jackrabbit.webdav.search.SearchInfo sInfo)
                                                throws org.apache.jackrabbit.webdav.DavException
Specified by:
search in interface org.apache.jackrabbit.webdav.search.SearchResource
Parameters:
sInfo -
Returns:
Throws:
org.apache.jackrabbit.webdav.DavException
See Also:
SearchResource.search(org.apache.jackrabbit.webdav.search.SearchInfo)

createResourceFromLocator

protected org.apache.jackrabbit.webdav.DavResource createResourceFromLocator(org.apache.jackrabbit.webdav.DavResourceLocator loc)
                                                                      throws org.apache.jackrabbit.webdav.DavException
Create a new DavResource from the given locator.

Parameters:
loc -
Returns:
new DavResource
Throws:
org.apache.jackrabbit.webdav.DavException

getLocatorFromItemPath

protected org.apache.jackrabbit.webdav.DavResourceLocator getLocatorFromItemPath(String itemPath)
Build a DavResourceLocator from the given itemPath path.

Parameters:
itemPath -
Returns:
a new DavResourceLocator
See Also:
DavLocatorFactory.createResourceLocator(String, String, String)

getLocatorFromItem

protected org.apache.jackrabbit.webdav.DavResourceLocator getLocatorFromItem(Item repositoryItem)
Build a new DavResourceLocator from the given repository item.

Parameters:
repositoryItem -
Returns:
a new locator for the specified item.
See Also:
AbstractResource.getLocatorFromItemPath(String)

getRepositorySession

protected Session getRepositorySession()
Shortcut for getSession().getRepositorySession()

Returns:
repository session present in the #session.


Copyright © 2005-2006 . All Rights Reserved.