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

    Constructors
    Constructor
    Description
    DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config)
    Create a new DavResource.
    DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config, boolean isCollection)
    Create a new DavResource
    DavResourceImpl(org.apache.jackrabbit.webdav.DavResourceLocator locator, DavResourceFactory factory, WebdavSession session, ResourceConfig config, Resource resource)
     
  • Method Summary

    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<? 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
     
    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
     
     
    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[]
     
    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 locked
    org.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 not null this implementation build a new ExportContext based on the specified context and forwards the export to its IOManager.
    void
    unlock(String lockToken)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 new DavResource.
      Parameters:
      locator - resource locator
      factory - resource factory
      session - current session
      config - 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 new DavResource
      Parameters:
      locator - resource locator
      factory - resource factory
      session - current session
      config - configuration
      isCollection - is the resource folder?
      Throws:
      org.apache.jackrabbit.webdav.DavException - error in the DAV communication
  • Method Details

    • getComplianceClass

      public String getComplianceClass()
      Specified by:
      getComplianceClass in interface org.apache.jackrabbit.webdav.DavResource
      Returns:
      DavResource#COMPLIANCE_CLASS
      See Also:
      • DavResource.getComplianceClass()
    • getSupportedMethods

      public String getSupportedMethods()
      Specified by:
      getSupportedMethods in interface org.apache.jackrabbit.webdav.DavResource
      Returns:
      DavResource#METHODS
      See Also:
      • DavResource.getSupportedMethods()
    • exists

      public boolean exists()
      Specified by:
      exists in interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • )
    • isCollection

      public boolean isCollection()
      Specified by:
      isCollection in interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.isCollection()
    • getLocator

      public org.apache.jackrabbit.webdav.DavResourceLocator getLocator()
      Specified by:
      getLocator in interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.getLocator()
    • getResourcePath

      public String getResourcePath()
      Specified by:
      getResourcePath in interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.getResourcePath()
    • getHref

      public String getHref()
      Specified by:
      getHref in interface org.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.
      Using the item name as DAV:displayname caused problems with XP built-in client in case of resources representing SameNameSibling nodes.
      Specified by:
      getDisplayName in interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.getDisplayName()
    • getModificationTime

      public long getModificationTime()
      Specified by:
      getModificationTime in interface org.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 not 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.
      Specified by:
      spool in interface org.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:
      getProperty in interface org.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 interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.getProperties()
    • getPropertyNames

      public org.apache.jackrabbit.webdav.property.DavPropertyName[] getPropertyNames()
      Specified by:
      getPropertyNames in interface org.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 properties
      removePropertyNames - 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 interface org.apache.jackrabbit.webdav.DavResource
      Throws:
      org.apache.jackrabbit.webdav.DavException
    • getCollection

      public org.apache.jackrabbit.webdav.DavResource getCollection()
      Specified by:
      getCollection in interface org.apache.jackrabbit.webdav.DavResource
      Returns:
      the resource
      See Also:
      • DavResource.getCollection()
    • getMembers

      public org.apache.jackrabbit.webdav.DavResourceIterator getMembers()
      Specified by:
      getMembers in interface org.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 interface org.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 interface org.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:
      move in interface org.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:
      copy in interface org.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:
      isLockable in interface org.apache.jackrabbit.webdav.DavResource
      Parameters:
      type - the type
      scope - the scope
      Returns:
      true if type is Type.WRITE and scope is Scope.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.apache.jackrabbit.webdav.DavResource
      See Also:
      • DavResource.getFactory()
    • getSession

      public org.apache.jackrabbit.webdav.DavSession getSession()
      Specified by:
      getSession in interface org.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 interface org.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 interface org.apache.jackrabbit.webdav.DavResource
      Throws:
      org.apache.jackrabbit.webdav.DavException