Package org.apache.jackrabbit.webdav.jcr
Class DefaultItemResource
- java.lang.Object
-
- org.apache.jackrabbit.webdav.jcr.DefaultItemResource
-
- All Implemented Interfaces:
org.apache.jackrabbit.commons.webdav.JcrRemotingConstants
,org.apache.jackrabbit.webdav.DavResource
,ItemResourceConstants
,org.apache.jackrabbit.webdav.observation.ObservationResource
,org.apache.jackrabbit.webdav.search.SearchResource
,org.apache.jackrabbit.webdav.transaction.TransactionResource
,org.apache.jackrabbit.webdav.version.DeltaVResource
public class DefaultItemResource extends Object
DefaultItemResource
represents JCR property item.- See Also:
Property
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
initedProps
protected Item
item
protected org.apache.jackrabbit.webdav.property.DavPropertyNameSet
names
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.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
-
-
Constructor Summary
Constructors Constructor Description DefaultItemResource(org.apache.jackrabbit.webdav.DavResourceLocator locator, JcrDavSession session, org.apache.jackrabbit.webdav.DavResourceFactory factory, Item item)
Create a newDefaultItemResource
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr)
void
addMember(org.apache.jackrabbit.webdav.DavResource resource, org.apache.jackrabbit.webdav.io.InputContext inputContext)
Method is not allowed.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(List<? extends org.apache.jackrabbit.webdav.property.PropEntry> changeList)
Loops over the givenList
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 newDavResource
from the given locator.boolean
exists()
Returns true if there exists arepository 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()
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()
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 newDavResourceLocator
from the given repository item.protected org.apache.jackrabbit.webdav.DavResourceLocator
getLocatorFromItemPath(String itemPath)
Build aDavResourceLocator
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)
JCR properties
are locked if their parent node is locked; thus this method will always return thelock
object from the collection this resource is internal member of.org.apache.jackrabbit.webdav.lock.ActiveLock[]
getLocks()
org.apache.jackrabbit.webdav.DavResourceIterator
getMembers()
Always returns an empty iterator for a non-collection resource might not have internal members.long
getModificationTime()
Always returns 'now'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 ofDavResource
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 forgetSession().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()
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()
Initialize theSupportedLock
property with entries that are valid for any type item resources.protected void
initProperties()
Add resource specific properties.protected void
initPropertyNames()
Property names common to all resources.protected void
initSupportedReports()
Define the set of reports supported by this resource.boolean
isCollection()
Returns false.boolean
isLockable(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
Returns true, if theSupportedLock
property contains an entry with the given type and scope.org.apache.jackrabbit.webdav.lock.ActiveLock
lock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo)
void
move(org.apache.jackrabbit.webdav.DavResource destination)
Moves the underlying repository item to the indicated destination.protected String
normalizeResourceHref(String href)
Normalize the resourcehref
.org.apache.jackrabbit.webdav.observation.EventDiscovery
poll(String subscriptionId, long timeout)
org.apache.jackrabbit.webdav.lock.ActiveLock
refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo info, String lockToken)
Only transaction lock may be available on this resource.void
removeMember(org.apache.jackrabbit.webdav.DavResource member)
Method is not allowed.void
removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName propertyName)
Removing properties is not allowed, for a single-value JCR-property without a value does not exist.org.apache.jackrabbit.webdav.MultiStatus
search(org.apache.jackrabbit.webdav.search.SearchInfo sInfo)
void
setProperty(org.apache.jackrabbit.webdav.property.DavProperty<?> property)
Sets the given property.void
spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext)
In case an underlying repositoryproperty
exists the following logic is applied to spool the property content: Property is not multi valued: Return thestream representation
of the property value. Property is multivalue: Return the xml representation of the values.org.apache.jackrabbit.webdav.observation.Subscription
subscribe(org.apache.jackrabbit.webdav.observation.SubscriptionInfo info, String subscriptionId)
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, org.apache.jackrabbit.webdav.transaction.TransactionInfo tInfo)
void
unsubscribe(String subscriptionId)
-
-
-
Field Detail
-
item
protected final Item item
-
initedProps
protected boolean initedProps
-
properties
protected org.apache.jackrabbit.webdav.property.DavPropertySet properties
-
names
protected org.apache.jackrabbit.webdav.property.DavPropertyNameSet names
-
supportedLock
protected org.apache.jackrabbit.webdav.lock.SupportedLock supportedLock
-
supportedReports
protected org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty supportedReports
-
-
Constructor Detail
-
DefaultItemResource
public DefaultItemResource(org.apache.jackrabbit.webdav.DavResourceLocator locator, JcrDavSession session, org.apache.jackrabbit.webdav.DavResourceFactory factory, Item item)
Create a newDefaultItemResource
.- Parameters:
locator
-session
-
-
-
Method Detail
-
isCollection
public boolean isCollection()
Returns false.- Returns:
- false
- See Also:
DavResource.isCollection()
-
getModificationTime
public long getModificationTime()
Always returns 'now'- Returns:
- See Also:
DavResource.getModificationTime()
-
spool
public void spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext) throws IOException
In case an underlying repositoryproperty
exists the following logic is applied to spool the property content:- Property is not multi valued: Return the
stream representation
of the property value. - Property is multivalue: Return the xml representation of the values.
- Specified by:
spool
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
outputContext
-- Throws:
IOException
- See Also:
DavResource.spool(OutputContext)
- Property is not multi valued: Return the
-
getProperty
public org.apache.jackrabbit.webdav.property.DavProperty<?> getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name)
- Specified by:
getProperty
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
setProperty
public void setProperty(org.apache.jackrabbit.webdav.property.DavProperty<?> property) throws org.apache.jackrabbit.webdav.DavException
Sets the given property. Note, thatItemResourceConstants.JCR_VALUE
andItemResourceConstants.JCR_VALUES
are the only resource properties that are allowed to be modified. Any other property is read-only and will throw an exception ('Conflict').- Specified by:
setProperty
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
property
-- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
-
removeProperty
public void removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName propertyName) throws org.apache.jackrabbit.webdav.DavException
Removing properties is not allowed, for a single-value JCR-property without a value does not exist. For multivalue properties an emptyvalues array
may be specified with by setting the'values' webdav property
.- Specified by:
removeProperty
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
propertyName
-- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
-
alterProperties
public org.apache.jackrabbit.webdav.MultiStatusResponse alterProperties(List<? extends org.apache.jackrabbit.webdav.property.PropEntry> changeList) throws org.apache.jackrabbit.webdav.DavException
Loops over the givenList
and alters the properties accordingly. Changes are persisted at the end only according to the rules defined with thecomplete()
method.Please note: since there is only a single property than can be set from a client (i.e. jcr:value OR jcr:values) this method either succeeds or throws an exception, even if this violates RFC 2518.
- Specified by:
alterProperties
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
changeList
-- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.alterProperties(List)
-
addMember
public void addMember(org.apache.jackrabbit.webdav.DavResource resource, org.apache.jackrabbit.webdav.io.InputContext inputContext) throws org.apache.jackrabbit.webdav.DavException
Method is not allowed.- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.addMember(org.apache.jackrabbit.webdav.DavResource, InputContext)
-
getMembers
public org.apache.jackrabbit.webdav.DavResourceIterator getMembers()
Always returns an empty iterator for a non-collection resource might not have internal members.- Returns:
- an empty iterator
- See Also:
DavResource.getMembers()
-
removeMember
public void removeMember(org.apache.jackrabbit.webdav.DavResource member) throws org.apache.jackrabbit.webdav.DavException
Method is not allowed.- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.removeMember(DavResource)
-
getLock
public org.apache.jackrabbit.webdav.lock.ActiveLock getLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
JCR properties
are locked if their parent node is locked; thus this method will always return thelock
object from the collection this resource is internal member of.- Specified by:
getLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
type
-scope
-- Returns:
- lock present on this resource or
null
if this resource has no lock. - See Also:
DavResource.getLock(Type, Scope)
-
initPropertyNames
protected void initPropertyNames()
Property names common to all resources.
-
initProperties
protected void initProperties()
Add resource specific 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 interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- string listing the compliance classes.
- See Also:
DavResource.getComplianceClass()
-
getSupportedMethods
public String getSupportedMethods()
- Specified by:
getSupportedMethods
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getSupportedMethods()
-
exists
public boolean exists()
Returns true if there exists arepository item
with the given resource path, false otherwise.- Specified by:
exists
in interfaceorg.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 display name is not equivalent toitem name
which is exposed with the{http://www.day.com/jcr/webdav/1.0}name
property.- Specified by:
getDisplayName
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getDisplayName()
-
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 aRootCollection
is returned.- Specified by:
getCollection
in interfaceorg.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 interfaceorg.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 interfaceorg.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)
-
init
public void init(org.apache.jackrabbit.webdav.observation.SubscriptionManager subsMgr)
- Specified by:
init
in interfaceorg.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 interfaceorg.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 interfaceorg.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, long timeout) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
poll
in interfaceorg.apache.jackrabbit.webdav.observation.ObservationResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
ObservationResource.poll(String, long)
,SubscriptionManager.poll(String, long, org.apache.jackrabbit.webdav.observation.ObservationResource)
-
initLockSupport
protected void initLockSupport()
Initialize theSupportedLock
property with entries that are valid for any type item resources.- See Also:
SupportedLock
,TxLockEntry
,AbstractResource.initLockSupport()
-
getWorkspaceHref
protected String getWorkspaceHref()
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 interfaceorg.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 itemnull
is returned.- Specified by:
getResourcePath
in interfaceorg.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 interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getHref()
,DavResourceLocator.getHref(boolean)
-
getPropertyNames
public org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()
- Specified by:
getPropertyNames
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getPropertyNames()
-
getProperties
public org.apache.jackrabbit.webdav.property.DavPropertySet getProperties()
- Specified by:
getProperties
in interfaceorg.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 theSupportedLock
property contains an entry with the given type and scope. By default resources allow fortransaction
lock only.- Specified by:
isLockable
in interfaceorg.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)
-
hasLock
public 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.- Specified by:
hasLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
type
-scope
-- Returns:
- true if this resource has a lock applied with the given type and scope.
- See Also:
DavResource.hasLock(Type, Scope)
-
getLocks
public org.apache.jackrabbit.webdav.lock.ActiveLock[] getLocks()
- Specified by:
getLocks
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
todo improve....
-
lock
public org.apache.jackrabbit.webdav.lock.ActiveLock lock(org.apache.jackrabbit.webdav.lock.LockInfo reqLockInfo) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
lock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.lock(org.apache.jackrabbit.webdav.lock.LockInfo)
-
refreshLock
public org.apache.jackrabbit.webdav.lock.ActiveLock refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo info, String lockToken) throws org.apache.jackrabbit.webdav.DavException
Only transaction lock may be available on this resource.- Specified by:
refreshLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
info
-lockToken
-- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)
-
unlock
public void unlock(String lockToken) throws org.apache.jackrabbit.webdav.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 interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
lockToken
-- Throws:
org.apache.jackrabbit.webdav.DavException
- Always throwsHttpServletResponse.SC_METHOD_NOT_ALLOWED
-
addLockManager
public void addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr)
- Specified by:
addLockManager
in interfaceorg.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 interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getFactory()
-
getSession
public org.apache.jackrabbit.webdav.DavSession getSession()
- Specified by:
getSession
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getSession()
,DavResource.getSession()
-
init
public void init(org.apache.jackrabbit.webdav.transaction.TxLockManager txMgr, String transactionId)
- Specified by:
init
in interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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. CallingaddWorkspace
on this resource will always fail.- Specified by:
addWorkspace
in interfaceorg.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 ofDavResource
objects that are referenced by the property with the specified name.- Specified by:
getReferenceResources
in interfaceorg.apache.jackrabbit.webdav.version.DeltaVResource
- Parameters:
hrefPropertyName
-- Returns:
- array of
DavResource
s - 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 interfaceorg.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 interfaceorg.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 newDavResource
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 aDavResourceLocator
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 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
.
-
initSupportedReports
protected void initSupportedReports()
Define the set of reports supported by this resource.- See Also:
SupportedReportSetProperty
,AbstractResource.initSupportedReports()
-
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.
-
-