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 visit
DavResourceImpl
- Author:
- Sebastian Wenzky
- See Also:
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.webdav.DavResource
METHODS
-
Constructor Summary
ConstructorDescriptionDavResourceImpl
(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config) Create a newDavResource
.DavResourceImpl
(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config, boolean isCollection) Create a newDavResource
DavResourceImpl
(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config, Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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<? extends org.apache.jackrabbit.webdav.property.PropEntry> 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
Returns the the last segment of the resource path.getExportContext
(org.apache.jackrabbit.webdav.io.OutputContext outputCtx) org.apache.jackrabbit.webdav.DavResourceFactory
getHref()
org.apache.jackrabbit.webdav.DavResourceLocator
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
long
org.apache.jackrabbit.webdav.property.DavPropertySet
org.apache.jackrabbit.webdav.property.DavProperty<?>
getProperty
(org.apache.jackrabbit.webdav.property.DavPropertyName name) org.apache.jackrabbit.webdav.property.DavPropertyName[]
org.apache.jackrabbit.webdav.DavSession
boolean
hasLock
(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope) boolean
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
-
Constructor Details
-
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config, Resource resource) -
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession 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, WebdavSession 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 Details
-
getComplianceClass
- Specified by:
getComplianceClass
in interfaceorg.apache.jackrabbit.webdav.DavResource
- Returns:
- DavResource#COMPLIANCE_CLASS
- See Also:
-
DavResource.getComplianceClass()
-
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
- Specified by:
getResourcePath
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
-
DavResource.getResourcePath()
-
getHref
- Specified by:
getHref
in interfaceorg.apache.jackrabbit.webdav.DavResource
- See Also:
-
DavResource.getHref()
-
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
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<? extends org.apache.jackrabbit.webdav.property.PropEntry> 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
- 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()- 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
-