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
ConstructorsConstructorDescriptionDavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfiguration config) Create a newDavResource.DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfiguration config, boolean isCollection) Create a newDavResourceDavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfiguration config, Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr) voidaddMember(org.apache.jackrabbit.webdav.DavResource member, org.apache.jackrabbit.webdav.io.InputContext inputContext) Adds a new member to this resource.org.apache.jackrabbit.webdav.MultiStatusResponsealterProperties(List<? extends org.apache.jackrabbit.webdav.property.PropEntry> changeList) org.apache.jackrabbit.webdav.MultiStatusResponsealterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet setProperties, org.apache.jackrabbit.webdav.property.DavPropertyNameSet removePropertyNames) voidcopy(org.apache.jackrabbit.webdav.DavResource destination, boolean shallow) booleanexists()org.apache.jackrabbit.webdav.DavResourceReturns the the last segment of the resource path.getExportContext(org.apache.jackrabbit.webdav.io.OutputContext outputCtx) org.apache.jackrabbit.webdav.DavResourceFactorygetHref()org.apache.jackrabbit.webdav.DavResourceLocatororg.apache.jackrabbit.webdav.lock.ActiveLockgetLock(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.DavResourceIteratorlongorg.apache.jackrabbit.webdav.property.DavPropertySetorg.apache.jackrabbit.webdav.property.DavProperty<?> getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name) org.apache.jackrabbit.webdav.property.DavPropertyName[]org.apache.jackrabbit.webdav.DavSessionbooleanhasLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope) booleanbooleanisLockable(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.ActiveLocklock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo) voidmove(org.apache.jackrabbit.webdav.DavResource destination) org.apache.jackrabbit.webdav.lock.ActiveLockrefreshLock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo, String lockToken) voidremoveMember(org.apache.jackrabbit.webdav.DavResource member) voidremoveProperty(org.apache.jackrabbit.webdav.property.DavPropertyName arg0) voidsetProperty(org.apache.jackrabbit.webdav.property.DavProperty<?> arg0) voidspool(org.apache.jackrabbit.webdav.io.OutputContext outputContext) If this resource exists and the specified context is notnullthis implementation build a newExportContextbased 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, ResourceConfiguration config, Resource resource) -
DavResourceImpl
public DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfiguration 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, ResourceConfiguration 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:
getComplianceClassin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- DavResource#COMPLIANCE_CLASS
- See Also:
-
getSupportedMethods
- Specified by:
getSupportedMethodsin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- DavResource#METHODS
- See Also:
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
isCollection
public boolean isCollection()- Specified by:
isCollectionin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getLocator
public org.apache.jackrabbit.webdav.DavResourceLocator getLocator()- Specified by:
getLocatorin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getResourcePath
- Specified by:
getResourcePathin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getHref
- Specified by:
getHrefin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
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:
getDisplayNamein interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getModificationTime
public long getModificationTime()- Specified by:
getModificationTimein interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
spool
If this resource exists and the specified context is notnullthis implementation build a newExportContextbased on the specified context and forwards the export to itsIOManager. If theIOManager.exportContent(ExportContext, DavResource)fails, anIOExceptionis thrown.- Specified by:
spoolin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
IOException- if the export fails- See Also:
-
getProperty
public org.apache.jackrabbit.webdav.property.DavProperty<?> getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName name) - Specified by:
getPropertyin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getProperties
public org.apache.jackrabbit.webdav.property.DavPropertySet getProperties()- Specified by:
getPropertiesin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getPropertyNames
public org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()- Specified by:
getPropertyNamesin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
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:
-
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:
alterPropertiesin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException
-
getCollection
public org.apache.jackrabbit.webdav.DavResource getCollection()- Specified by:
getCollectionin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- the resource
- See Also:
-
getMembers
public org.apache.jackrabbit.webdav.DavResourceIterator getMembers()- Specified by:
getMembersin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- an iterator
- See Also:
-
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:
addMemberin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException- See Also:
-
removeMember
public void removeMember(org.apache.jackrabbit.webdav.DavResource member) throws org.apache.jackrabbit.webdav.DavException - Specified by:
removeMemberin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException
-
move
public void move(org.apache.jackrabbit.webdav.DavResource destination) throws org.apache.jackrabbit.webdav.DavException - Specified by:
movein interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException
-
copy
public void copy(org.apache.jackrabbit.webdav.DavResource destination, boolean shallow) throws org.apache.jackrabbit.webdav.DavException - Specified by:
copyin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException
-
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:
isLockablein interfaceorg.apache.jackrabbit.webdav.DavResource- Parameters:
type- the typescope- the scope- Returns:
- true if type is
Type.WRITEand scope isScope.EXCLUSIVE - See Also:
-
hasLock
public boolean hasLock(org.apache.jackrabbit.webdav.lock.Type type, org.apache.jackrabbit.webdav.lock.Scope scope) - Specified by:
hasLockin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- if there is a lock
- See Also:
-
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:
getLockin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- the active lock
- See Also:
-
getLocks
public org.apache.jackrabbit.webdav.lock.ActiveLock[] getLocks()- Specified by:
getLocksin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- the active locks
- See Also:
-
lock
public org.apache.jackrabbit.webdav.lock.ActiveLock lock(org.apache.jackrabbit.webdav.lock.LockInfo lockInfo) throws org.apache.jackrabbit.webdav.DavException - Specified by:
lockin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- the active lock
- Throws:
org.apache.jackrabbit.webdav.DavException- See Also:
-
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:
refreshLockin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException- See Also:
-
unlock
- Specified by:
unlockin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException- See Also:
-
addLockManager
public void addLockManager(org.apache.jackrabbit.webdav.lock.LockManager lockMgr) - Specified by:
addLockManagerin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getFactory
public org.apache.jackrabbit.webdav.DavResourceFactory getFactory()- Specified by:
getFactoryin interfaceorg.apache.jackrabbit.webdav.DavResource- See Also:
-
getSession
public org.apache.jackrabbit.webdav.DavSession getSession()- Specified by:
getSessionin interfaceorg.apache.jackrabbit.webdav.DavResource- Returns:
- the session
- See Also:
-
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:
-
removeProperty
public void removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName arg0) throws org.apache.jackrabbit.webdav.DavException - Specified by:
removePropertyin 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:
setPropertyin interfaceorg.apache.jackrabbit.webdav.DavResource- Throws:
org.apache.jackrabbit.webdav.DavException
-