Package com.logicaldoc.webdav.resource
Class DavResourceImpl
- java.lang.Object
-
- com.logicaldoc.webdav.resource.DavResourceImpl
-
- All Implemented Interfaces:
Serializable
,org.apache.jackrabbit.webdav.DavResource
- Direct Known Subclasses:
DeltaVResourceImpl
,RangeResourceImpl
public class DavResourceImpl extends Object implements org.apache.jackrabbit.webdav.DavResource, Serializable
For more informations, please visitDavResourceImpl
- Author:
- Sebastian Wenzky
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config)
Create a newDavResource
.DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, boolean isCollection)
Create a newDavResource
DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr)
void
addMember(org.apache.jackrabbit.webdav.DavResource member, org.apache.jackrabbit.webdav.io.InputContext inputContext)
Adds a new member to this resource.org.apache.jackrabbit.webdav.MultiStatusResponse
alterProperties(List changeList)
org.apache.jackrabbit.webdav.MultiStatusResponse
alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet setProperties, org.apache.jackrabbit.webdav.property.DavPropertyNameSet removePropertyNames)
void
copy(org.apache.jackrabbit.webdav.DavResource destination, boolean shallow)
boolean
exists()
org.apache.jackrabbit.webdav.DavResource
getCollection()
String
getComplianceClass()
String
getDisplayName()
Returns the the last segment of the resource path.ExportContext
getExportContext(org.apache.jackrabbit.webdav.io.OutputContext outputCtx)
org.apache.jackrabbit.webdav.DavResourceFactory
getFactory()
Deprecated.JackRabbit usageString
getHref()
org.apache.jackrabbit.webdav.DavResourceLocator
getLocator()
org.apache.jackrabbit.webdav.lock.ActiveLock
getLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
org.apache.jackrabbit.webdav.lock.ActiveLock[]
getLocks()
org.apache.jackrabbit.webdav.DavResourceIterator
getMembers()
long
getModificationTime()
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()
String
getResourcePath()
org.apache.jackrabbit.webdav.DavSession
getSession()
String
getSupportedMethods()
boolean
hasLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
boolean
isCollection()
boolean
isLockable(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
Checks if a resource can be lockedorg.apache.jackrabbit.webdav.lock.ActiveLock
lock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo)
void
move(org.apache.jackrabbit.webdav.DavResource destination)
org.apache.jackrabbit.webdav.lock.ActiveLock
refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo, String lockToken)
void
removeMember(org.apache.jackrabbit.webdav.DavResource member)
void
removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName arg0)
void
setProperty(org.apache.jackrabbit.webdav.property.DavProperty<?> arg0)
void
spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext)
If this resource exists and the specified context is notnull
this implementation build a newExportContext
based on the specified context and forwards the export to itsIOManager
.void
unlock(String lockToken)
-
-
-
Constructor Detail
-
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, Resource resource)
-
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config) throws org.apache.jackrabbit.webdav.DavException
Create a newDavResource
.- Parameters:
locator
- resource locatorfactory
- resource factorysession
- current sessionconfig
- configuration- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, boolean isCollection) throws org.apache.jackrabbit.webdav.DavException
Create a newDavResource
- Parameters:
locator
- resource locatorfactory
- resource factorysession
- current sessionconfig
- configurationisCollection
- is the resource folder?- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
-
Method Detail
-
getComplianceClass
public String getComplianceClass()
- Specified by:
getComplianceClass
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- DavResource#COMPLIANCE_CLASS
- See Also:
DavResource.getComplianceClass()
-
getSupportedMethods
public String getSupportedMethods()
- Specified by:
getSupportedMethods
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- DavResource#METHODS
- See Also:
DavResource.getSupportedMethods()
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
)
-
isCollection
public boolean isCollection()
- Specified by:
isCollection
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.isCollection()
-
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()
- Specified by:
getResourcePath
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getResourcePath()
-
getHref
public String getHref()
- Specified by:
getHref
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getHref()
-
getDisplayName
public String getDisplayName()
Returns the the last segment of the resource path.Note that this must not correspond to the name of the underlying repository item for two reasons:
- SameNameSiblings have an index appended to their item name.
- the resource path may differ from the item path.
- Specified by:
getDisplayName
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getDisplayName()
-
getModificationTime
public long getModificationTime()
- Specified by:
getModificationTime
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getModificationTime()
-
spool
public void spool(org.apache.jackrabbit.webdav.io.OutputContext outputContext) throws IOException
If this resource exists and the specified context is notnull
this implementation build a newExportContext
based on the specified context and forwards the export to itsIOManager
. If theIOManager.exportContent(ExportContext, DavResource)
fails, anIOException
is thrown.- Specified by:
spool
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
IOException
- if the export fails- See Also:
DavResource.spool(OutputContext)
,ResourceConfig.getIOManager()
-
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)
-
getProperties
public org.apache.jackrabbit.webdav.property.DavPropertySet getProperties()
- Specified by:
getProperties
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getProperties()
-
getPropertyNames
public org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()
- Specified by:
getPropertyNames
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
DavResource.getPropertyNames()
-
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
- Parameters:
setProperties
- DAV propertiesremovePropertyNames
- DAV properties names- Returns:
- the status
- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication- See Also:
DavResource.alterProperties(List)
-
alterProperties
public org.apache.jackrabbit.webdav.MultiStatusResponse alterProperties(List changeList) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
alterProperties
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
-
getCollection
public org.apache.jackrabbit.webdav.DavResource getCollection()
- Specified by:
getCollection
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- the resource
- See Also:
DavResource.getCollection()
-
getMembers
public org.apache.jackrabbit.webdav.DavResourceIterator getMembers()
- Specified by:
getMembers
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- an iterator
- See Also:
DavResource.getMembers()
-
addMember
public void addMember(org.apache.jackrabbit.webdav.DavResource member, org.apache.jackrabbit.webdav.io.InputContext inputContext) throws org.apache.jackrabbit.webdav.DavException
Adds a new member to this resource.- Specified by:
addMember
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.addMember(DavResource, org.apache.jackrabbit.webdav.io.InputContext)
-
removeMember
public void removeMember(org.apache.jackrabbit.webdav.DavResource member) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
removeMember
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.removeMember(DavResource)
-
move
public void move(org.apache.jackrabbit.webdav.DavResource destination) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
move
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.move(DavResource)
-
copy
public void copy(org.apache.jackrabbit.webdav.DavResource destination, boolean shallow) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
copy
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.copy(DavResource, boolean)
-
isLockable
public boolean isLockable(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope)
Checks if a resource can be locked- Specified by:
isLockable
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Parameters:
type
- the typescope
- the scope- Returns:
- true if type is
Type.WRITE
and scope isScope.EXCLUSIVE
- 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)
- Specified by:
hasLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- if there is a lock
- 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)
- Specified by:
getLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- the active lock
- See Also:
DavResource.getLock(Type, Scope)
-
getLocks
public org.apache.jackrabbit.webdav.lock.ActiveLock[] getLocks()
- Specified by:
getLocks
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- the active locks
- See Also:
DavResource.getLocks()
-
lock
public org.apache.jackrabbit.webdav.lock.ActiveLock lock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
lock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- the active lock
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.lock(LockInfo)
-
refreshLock
public org.apache.jackrabbit.webdav.lock.ActiveLock refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo, String lockToken) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
refreshLock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.refreshLock(LockInfo, String)
-
unlock
public void unlock(String lockToken) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
unlock
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
- See Also:
DavResource.unlock(String)
-
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()
Deprecated.JackRabbit usage- 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
- Returns:
- the session
- See Also:
DavResource.getSession()
-
getExportContext
public ExportContext getExportContext(org.apache.jackrabbit.webdav.io.OutputContext outputCtx) throws IOException
- Parameters:
outputCtx
- output context- Returns:
- the export context
- Throws:
IOException
- a generic exception- See Also:
DavResourceImpl.getExportContext(OutputContext)
-
removeProperty
public void removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName arg0) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
removeProperty
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
-
setProperty
public void setProperty(org.apache.jackrabbit.webdav.property.DavProperty<?> arg0) throws org.apache.jackrabbit.webdav.DavException
- Specified by:
setProperty
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Throws:
org.apache.jackrabbit.webdav.DavException
-
-