|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.webdav.simple.DavResourceImpl
public class DavResourceImpl
DavResourceImpl implements a DavResource.
| Field Summary | |
|---|---|
static java.lang.String |
COMPLIANCE_CLASSES
|
static java.lang.String |
METHODS
|
protected DavPropertySet |
properties
|
protected boolean |
propsInitialized
|
| Constructor Summary | |
|---|---|
DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config)
Deprecated. |
|
DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config,
boolean isCollection)
Create a new DavResource. |
|
DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config,
javax.jcr.Node node)
Create a new DavResource. |
|
| Method Summary | |
|---|---|
void |
addLockManager(LockManager lockMgr)
Add an external LockManager to this resource. |
void |
addMember(DavResource member,
InputContext inputContext)
Adds a new member to this resource. |
MultiStatusResponse |
alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
Set/add the specified properties and remove the properties with the given names from this resource respectively. |
MultiStatusResponse |
alterProperties(java.util.List changeList)
Set/add and remove the specified properties from this resource. |
void |
bind(DavResource collection,
DavResource newBinding)
Will add a new binding to the given collection referencing this resource. |
void |
copy(DavResource destination,
boolean shallow)
Copy this DavResource to the given destination resource |
boolean |
exists()
Returns true if this webdav resource represents an existing repository item. |
DavResource |
getCollection()
Retrieve the resource this resource is internal member of. |
java.lang.String |
getComplianceClass()
Returns a comma separated list of all compliance classes the given resource is fulfilling. |
java.lang.String |
getDisplayName()
Returns the the last segment of the resource path. |
protected ExportContext |
getExportContext(OutputContext outputCtx)
Returns a new ExportContext |
DavResourceFactory |
getFactory()
Return the DavResourceFactory that created this resource. |
java.lang.String |
getHref()
Returns the absolute href of this resource as returned in the multistatus response body. |
protected ImportContext |
getImportContext(InputContext inputCtx,
java.lang.String systemId)
Returns a new ImportContext |
DavResourceLocator |
getLocator()
Returns the locator object for this webdav resource,
which encapsulates the information for building the complete 'href'. |
ActiveLock |
getLock(Type type,
Scope scope)
Return the lock present on this webdav resource or null
if the resource is either not locked or not lockable at all. |
ActiveLock[] |
getLocks()
Returns an array of all locks applied to the given resource. |
DavResourceIterator |
getMembers()
Returns an iterator over all internal members. |
long |
getModificationTime()
Return the time of the last modification or -1 if the modification time could not be retrieved. |
protected javax.jcr.Node |
getNode()
Returns the node that is wrapped by this resource. |
java.util.Set |
getParentElements()
Will retrieve a collection of parent elements of the bindable resource representing the parent set. |
DavPropertySet |
getProperties()
Returns all webdav properties present on this resource. |
DavProperty |
getProperty(DavPropertyName name)
Return the webdav property with the specified name. |
protected PropertyExportContext |
getPropertyExportContext()
Returns a new PropertyExportContext. |
protected PropertyImportContext |
getPropertyImportContext(java.util.List changeList)
Returns a new PropertyImportContext. |
DavPropertyName[] |
getPropertyNames()
Returns an array of all property names available
on this resource. |
java.lang.String |
getResourcePath()
Returns the path of the hierarchy element defined by this DavResource. |
DavSession |
getSession()
Retrieve the DavSession associated with this resource. |
java.lang.String |
getSupportedMethods()
Returns a comma separated list of all METHODS supported by the given resource. |
boolean |
hasLock(Type type,
Scope scope)
Returns true if a lock applies to this resource. |
protected void |
initProperties()
Fill the set of properties |
boolean |
isCollection()
Returns true if this webdav resource has the resourcetype 'collection'. |
boolean |
isLockable(Type type,
Scope scope)
Returns true, if the this resource allows locking. |
ActiveLock |
lock(LockInfo lockInfo)
Lock this webdav resource with the information retrieve from the request and return the resulting lockdiscovery object. |
void |
move(DavResource destination)
Move this DavResource to the given destination resource |
void |
rebind(DavResource collection,
DavResource newBinding)
Will rebind the resource to the given collection. |
ActiveLock |
refreshLock(LockInfo lockInfo,
java.lang.String lockToken)
Refresh an existing lock by resetting the timeout. |
void |
removeMember(DavResource member)
Removes the specified member from this resource. |
void |
removeProperty(DavPropertyName propertyName)
Remove the specified property from this resource. |
void |
setProperty(DavProperty property)
Add/Set the specified property on this resource. |
void |
spool(OutputContext outputContext)
If this resource exists and the specified context is not null
this implementation build a new ExportContext based on the specified
context and forwards the export to its IOManager. |
void |
unlock(java.lang.String lockToken)
Remove the lock identified by the included lock token from this resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String METHODS
public static final java.lang.String COMPLIANCE_CLASSES
protected DavPropertySet properties
protected boolean propsInitialized
| Constructor Detail |
|---|
public DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config)
throws DavException
DavResource.
locator - factory - session -
DavException
public DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config,
boolean isCollection)
throws DavException
DavResource.
locator - factory - session - config - isCollection -
DavException
public DavResourceImpl(DavResourceLocator locator,
DavResourceFactory factory,
DavSession session,
ResourceConfig config,
javax.jcr.Node node)
throws DavException
DavResource.
locator - factory - session - config - node -
DavException| Method Detail |
|---|
public java.lang.String getComplianceClass()
DavResource
getComplianceClass in interface DavResourceDavResource.getComplianceClass()public java.lang.String getSupportedMethods()
DavResource
getSupportedMethods in interface DavResourceDavResource.getSupportedMethods()public boolean exists()
DavResource
exists in interface DavResource)public boolean isCollection()
DavResource
isCollection in interface DavResourceDavResource.isCollection()public DavResourceLocator getLocator()
DavResourcelocator object for this webdav resource,
which encapsulates the information for building the complete 'href'.
getLocator in interface DavResourceDavResource.getLocator()public java.lang.String getResourcePath()
DavResourceDavResource.
This method is a shortcut for DavResource.getLocator().getResourcePath().
getResourcePath in interface DavResourceDavResource.DavResource.getResourcePath()public java.lang.String getHref()
DavResource
getHref in interface DavResourceDavResource.getHref()public java.lang.String getDisplayName()
Note that this must not correspond to the name of the underlying repository item for two reasons:
getDisplayName in interface DavResourceDavResource.getDisplayName()public long getModificationTime()
DavResource
getModificationTime in interface DavResourceDavResource.getModificationTime()
public void spool(OutputContext outputContext)
throws java.io.IOException
null
this implementation build a new ExportContext based on the specified
context and forwards the export to its IOManager. If the
IOManager.exportContent(ExportContext, DavResource) fails,
an IOException is thrown.
spool in interface DavResourcejava.io.IOException - if the export fails.DavResource.spool(OutputContext),
ResourceConfig.getIOManager()public DavProperty getProperty(DavPropertyName name)
DavResource
getProperty in interface DavResourcename - name of the webdav property
DavProperty with the given name or null
if the property does not exist.DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)public DavPropertySet getProperties()
DavResource
getProperties in interface DavResourceDavPropertySet containing all webdav property
of this resource.DavResource.getProperties()public DavPropertyName[] getPropertyNames()
DavResourceproperty names available
on this resource.
getPropertyNames in interface DavResourceDavResource.getPropertyNames()protected void initProperties()
public void setProperty(DavProperty property)
throws DavException
DavResource
setProperty in interface DavResourceproperty -
DavExceptionDavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
public void removeProperty(DavPropertyName propertyName)
throws DavException
DavResource
removeProperty in interface DavResourcepropertyName -
DavExceptionDavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
public MultiStatusResponse alterProperties(DavPropertySet setProperties,
DavPropertyNameSet removePropertyNames)
throws DavException
DavResource
alterProperties in interface DavResourcesetProperties - Set of properties to be added or modifiedremovePropertyNames - Set of property names to be removed
DavException - if an error occurred. This may be the case if the
general state of the resource prevents any properties to be set or removed
(e.g. due to a lock).DavResource.alterProperties(DavPropertySet, DavPropertyNameSet)
public MultiStatusResponse alterProperties(java.util.List changeList)
throws DavException
DavResource
alterProperties in interface DavResourcechangeList - list containing DavPropertyName objects (for
properties to be removed) and DavProperty objects (for
properties to be added/set).
DavException - if an error occurred. This may be the case if the
general state of the resource prevents any properties to be set or removed
(e.g. due to a lock).public DavResource getCollection()
DavResource
getCollection in interface DavResourcenull is returned.DavResource.getCollection()public DavResourceIterator getMembers()
DavResource
getMembers in interface DavResourceDavResourceIterator over all internal members.DavResource.getMembers()
public void addMember(DavResource member,
InputContext inputContext)
throws DavException
addMember in interface DavResourcemember - DavResource to be added as internal member.inputContext - Context providing the properties and content for the
internal member to be created or replaced.
DavExceptionDavResource.addMember(DavResource, org.apache.jackrabbit.webdav.io.InputContext)
public void removeMember(DavResource member)
throws DavException
DavResource
removeMember in interface DavResourceDavExceptionDavResource.removeMember(DavResource)
public void move(DavResource destination)
throws DavException
DavResource
move in interface DavResourceDavExceptionDavResource.move(DavResource)
public void copy(DavResource destination,
boolean shallow)
throws DavException
DavResource
copy in interface DavResourceDavExceptionDavResource.copy(DavResource, boolean)
public boolean isLockable(Type type,
Scope scope)
DavResource
isLockable in interface DavResourcetype - scope -
Type.WRITE and scope is Scope.EXCLUSIVEDavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public boolean hasLock(Type type,
Scope scope)
DavResource
hasLock in interface DavResourceDavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public ActiveLock getLock(Type type,
Scope scope)
DavResourcenull
if the resource is either not locked or not lockable at all. Note, that
a resource may have a lock that is inherited by a deep lock enforced on
one of its 'parent' resources.
getLock in interface DavResourcenull if this
resource has no lock applying it. If an error occurs while retrieving the
lock information null is returned as well.DavResource.getLock(Type, Scope)public ActiveLock[] getLocks()
DavResource
getLocks in interface DavResourceDavResource.getLocks()
public ActiveLock lock(LockInfo lockInfo)
throws DavException
DavResource
lock in interface DavResourcelockInfo - lock info as retrieved from the request.
DavException is thrown.
DavException - if the lock could not be obtained.DavResource.lock(LockInfo)
public ActiveLock refreshLock(LockInfo lockInfo,
java.lang.String lockToken)
throws DavException
DavResource
refreshLock in interface DavResourcelockInfo - lock info as retrieved from the request.lockToken - identifying the lock to be refreshed.
DavException is thrown.
DavException - if the lock could not be refreshed.DavResource.refreshLock(LockInfo, String)
public void unlock(java.lang.String lockToken)
throws DavException
DavResource
unlock in interface DavResourcelockToken - identifying the lock to be removed.
DavException - if the lock could not be removed.DavResource.unlock(String)public void addLockManager(LockManager lockMgr)
DavResourceLockManager to this resource. This method may
throw UnsupportedOperationException if the resource does handle
locking itself.
addLockManager in interface DavResourceDavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)public DavResourceFactory getFactory()
DavResourceDavResourceFactory that created this resource.
getFactory in interface DavResourceDavResource.getFactory()public DavSession getSession()
DavResourceDavSession associated with this resource.
getSession in interface DavResourceDavResource.getSession()
public void bind(DavResource collection,
DavResource newBinding)
throws DavException
BindableResource
bind in interface BindableResourcecollection - the collection to create the new binding in.newBinding - the new binding
DavExceptionBindableResource.rebind(DavResource, DavResource)
public void rebind(DavResource collection,
DavResource newBinding)
throws DavException
BindableResource
rebind in interface BindableResourcecollection - the collection to create the new binding in.newBinding - the new binding
DavExceptionBindableResource.rebind(DavResource, DavResource)public java.util.Set getParentElements()
BindableResource
getParentElements in interface BindableResourceBindableResource.getParentElements()protected javax.jcr.Node getNode()
protected ImportContext getImportContext(InputContext inputCtx,
java.lang.String systemId)
throws java.io.IOException
ImportContext
inputCtx - systemId -
java.io.IOException
protected ExportContext getExportContext(OutputContext outputCtx)
throws java.io.IOException
ExportContext
outputCtx -
java.io.IOExceptionprotected PropertyImportContext getPropertyImportContext(java.util.List changeList)
PropertyImportContext.
changeList -
protected PropertyExportContext getPropertyExportContext()
PropertyExportContext.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||