|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.webdav.simple.DavResourceImpl
public class DavResourceImpl
DavResourceImpl implements a DavResource.
Field Summary | |
---|---|
static String |
COMPLIANCE_CLASSES
|
static 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,
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(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. |
String |
getComplianceClass()
Returns a comma separated list of all compliance classes the given resource is fulfilling. |
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. |
String |
getHref()
Returns the absolute href of this resource as returned in the multistatus response body. |
protected ImportContext |
getImportContext(InputContext inputCtx,
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 Node |
getNode()
Returns the node that is wrapped by this resource. |
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(List changeList)
Returns a new PropertyImportContext . |
DavPropertyName[] |
getPropertyNames()
Returns an array of all property names available
on this resource. |
String |
getResourcePath()
Returns the path of the hierarchy element defined by this DavResource . |
DavSession |
getSession()
Retrieve the DavSession associated with this resource. |
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,
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(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 String METHODS
public static final 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, Node node) throws DavException
DavResource
.
locator
- factory
- session
- config
- node
-
DavException
Method Detail |
---|
public String getComplianceClass()
DavResource
getComplianceClass
in interface DavResource
DavResource.getComplianceClass()
public String getSupportedMethods()
DavResource
getSupportedMethods
in interface DavResource
DavResource.getSupportedMethods()
public boolean exists()
DavResource
exists
in interface DavResource
)
public boolean isCollection()
DavResource
isCollection
in interface DavResource
DavResource.isCollection()
public DavResourceLocator getLocator()
DavResource
locator
object for this webdav resource,
which encapsulates the information for building the complete 'href'.
getLocator
in interface DavResource
DavResource.getLocator()
public String getResourcePath()
DavResource
DavResource
.
This method is a shortcut for DavResource.getLocator().getResourcePath()
.
getResourcePath
in interface DavResource
DavResource
.DavResource.getResourcePath()
public String getHref()
DavResource
getHref
in interface DavResource
DavResource.getHref()
public String getDisplayName()
Note that this must not correspond to the name of the underlying repository item for two reasons:
getDisplayName
in interface DavResource
DavResource.getDisplayName()
public long getModificationTime()
DavResource
getModificationTime
in interface DavResource
DavResource.getModificationTime()
public void spool(OutputContext outputContext) throws 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 DavResource
IOException
- if the export fails.DavResource.spool(OutputContext)
,
ResourceConfig.getIOManager()
public DavProperty getProperty(DavPropertyName name)
DavResource
getProperty
in interface DavResource
name
- 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 DavResource
DavPropertySet
containing all webdav property
of this resource.DavResource.getProperties()
public DavPropertyName[] getPropertyNames()
DavResource
property names
available
on this resource.
getPropertyNames
in interface DavResource
DavResource.getPropertyNames()
protected void initProperties()
public void setProperty(DavProperty property) throws DavException
DavResource
setProperty
in interface DavResource
property
-
DavException
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
public void removeProperty(DavPropertyName propertyName) throws DavException
DavResource
removeProperty
in interface DavResource
propertyName
-
DavException
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
public MultiStatusResponse alterProperties(DavPropertySet setProperties, DavPropertyNameSet removePropertyNames) throws DavException
DavResource
alterProperties
in interface DavResource
setProperties
- 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(List changeList) throws DavException
DavResource
alterProperties
in interface DavResource
changeList
- 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 DavResource
null
is returned.DavResource.getCollection()
public DavResourceIterator getMembers()
DavResource
getMembers
in interface DavResource
DavResourceIterator
over all internal members.DavResource.getMembers()
public void addMember(DavResource member, InputContext inputContext) throws DavException
addMember
in interface DavResource
member
- DavResource
to be added as internal member.inputContext
- Context providing the properties and content for the
internal member to be created or replaced.
DavException
DavResource.addMember(DavResource, org.apache.jackrabbit.webdav.io.InputContext)
public void removeMember(DavResource member) throws DavException
DavResource
removeMember
in interface DavResource
DavException
DavResource.removeMember(DavResource)
public void move(DavResource destination) throws DavException
DavResource
move
in interface DavResource
DavException
DavResource.move(DavResource)
public void copy(DavResource destination, boolean shallow) throws DavException
DavResource
copy
in interface DavResource
DavException
DavResource.copy(DavResource, boolean)
public boolean isLockable(Type type, Scope scope)
DavResource
isLockable
in interface DavResource
type
- scope
-
Type.WRITE
and scope is Scope.EXCLUSIVE
DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public boolean hasLock(Type type, Scope scope)
DavResource
hasLock
in interface DavResource
DavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
public ActiveLock getLock(Type type, Scope scope)
DavResource
null
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 DavResource
null
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 DavResource
DavResource.getLocks()
public ActiveLock lock(LockInfo lockInfo) throws DavException
DavResource
lock
in interface DavResource
lockInfo
- 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, String lockToken) throws DavException
DavResource
refreshLock
in interface DavResource
lockInfo
- 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(String lockToken) throws DavException
DavResource
unlock
in interface DavResource
lockToken
- identifying the lock to be removed.
DavException
- if the lock could not be removed.DavResource.unlock(String)
public void addLockManager(LockManager lockMgr)
DavResource
LockManager
to this resource. This method may
throw UnsupportedOperationException
if the resource does handle
locking itself.
addLockManager
in interface DavResource
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)
public DavResourceFactory getFactory()
DavResource
DavResourceFactory
that created this resource.
getFactory
in interface DavResource
DavResource.getFactory()
public DavSession getSession()
DavResource
DavSession
associated with this resource.
getSession
in interface DavResource
DavResource.getSession()
public void bind(DavResource collection, DavResource newBinding) throws DavException
BindableResource
bind
in interface BindableResource
collection
- the collection to create the new binding in.newBinding
- the new binding
DavException
BindableResource.rebind(DavResource, DavResource)
public void rebind(DavResource collection, DavResource newBinding) throws DavException
BindableResource
rebind
in interface BindableResource
collection
- the collection to create the new binding in.newBinding
- the new binding
DavException
BindableResource.rebind(DavResource, DavResource)
public Set getParentElements()
BindableResource
getParentElements
in interface BindableResource
BindableResource.getParentElements()
protected Node getNode()
protected ImportContext getImportContext(InputContext inputCtx, String systemId) throws IOException
ImportContext
inputCtx
- systemId
-
IOException
protected ExportContext getExportContext(OutputContext outputCtx) throws IOException
ExportContext
outputCtx
-
IOException
protected PropertyImportContext getPropertyImportContext(List changeList)
PropertyImportContext
.
changeList
-
protected PropertyExportContext getPropertyExportContext()
PropertyExportContext
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |