Class DavResourceImpl

    • 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()
      • getSessionXXX

        public DavSession getSessionXXX()
        Returns:
        the session
        See Also:
        DavResource.getSession()
      • getResourceXXX

        public Resource getResourceXXX()
        Returns the current resource that holds this object
        Returns:
        the resource
      • getConfigXXX

        public ResourceConfig getConfigXXX()
        Returns the current resource that holds this object
        Returns:
        the resource
      • 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