Class DavResourceImpl

  • All Implemented Interfaces:
    Serializable, org.apache.jackrabbit.webdav.DavResource
    Direct Known Subclasses:
    DeltaVResourceImpl

    public class DavResourceImpl
    extends Object
    implements org.apache.jackrabbit.webdav.DavResource, Serializable
    For more informations, please visit DavResourceImpl
    Author:
    Sebastian Wenzky
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface org.apache.jackrabbit.webdav.DavResource

        METHODS
    • 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.
      org.apache.jackrabbit.webdav.DavResourceFactory getFactory()
      Deprecated.
      JackRabbit usage
      String 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 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)  
    • Constructor Detail

      • DavResourceImpl

        public DavResourceImpl​(org.apache.jackrabbit.webdav.DavResourceLocator locator,
                               DavResourceFactory factory,
                               DavSession 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,
                               DavSession 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 Detail

      • 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:
        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 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 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
        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 interface org.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 interface org.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 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()
        Deprecated.
        JackRabbit usage
        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()
      • 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