Interface WebdavStore

  • All Known Implementing Classes:
    LocalFileSystemStore

    public interface WebdavStore
    Interface for simple implementation of any store for the WebdavServlet

    based on the BasicWebdavStore from Oliver Zeigermann, that was part of the Webdav Construcktion Kit from slide

    • Method Detail

      • destroy

        void destroy()
        Life cycle method, called by WebdavServlet's destroy() method. Should be used to clean up resources.
      • checkAuthentication

        void checkAuthentication​(Transaction transaction)
        Checks if authentication information passed in is valid. If not throws an exception.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
      • commit

        void commit​(Transaction transaction)
        Indicates that all changes done inside this request shall be made permanent and any transactions, connections and other temporary resources shall be terminated.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        Throws:
        WebdavException - if something goes wrong on the store level
      • rollback

        void rollback​(Transaction transaction)
        Indicates that all changes done inside this request shall be undone and any transactions, connections and other temporary resources shall be terminated.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        Throws:
        WebdavException - if something goes wrong on the store level
      • createFolder

        void createFolder​(Transaction transaction,
                          String folderUri)
        Creates a folder at the position specified by folderUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        folderUri - URI of the folder
        Throws:
        WebdavException - if something goes wrong on the store level
      • createResource

        void createResource​(Transaction transaction,
                            String resourceUri)
        Creates a content resource at the position specified by resourceUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        resourceUri - URI of the content resource
        Throws:
        WebdavException - if something goes wrong on the store level
      • getResourceContent

        InputStream getResourceContent​(Transaction transaction,
                                       String resourceUri)
        Gets the content of the resource specified by resourceUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        resourceUri - URI of the content resource
        Returns:
        input stream you can read the content of the resource from
        Throws:
        WebdavException - if something goes wrong on the store level
      • setResourceContent

        long setResourceContent​(Transaction transaction,
                                String resourceUri,
                                InputStream content,
                                String contentType,
                                String characterEncoding)
        Sets / stores the content of the resource specified by resourceUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        resourceUri - URI of the resource where the content will be stored
        content - input stream from which the content will be read from
        contentType - content type of the resource or null if unknown
        characterEncoding - character encoding of the resource or null if unknown or not applicable
        Returns:
        lenght of resource
        Throws:
        WebdavException - if something goes wrong on the store level
      • getChildrenNames

        String[] getChildrenNames​(Transaction transaction,
                                  String folderUri)
        Gets the names of the children of the folder specified by folderUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        folderUri - URI of the folder
        Returns:
        a (possibly empty) list of children, or null if the uri points to a file
        Throws:
        WebdavException - if something goes wrong on the store level
      • getResourceLength

        long getResourceLength​(Transaction transaction,
                               String path)
        Gets the length of the content resource specified by resourceUri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        path - URI of the content resource
        Returns:
        length of the resource in bytes, -1 declares this value as invalid and asks the adapter to try to set it from the properties if possible
        Throws:
        WebdavException - if something goes wrong on the store level
      • removeObject

        void removeObject​(Transaction transaction,
                          String uri)
        Removes the object specified by uri.
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        uri - URI of the object, i.e. content resource or folder
        Throws:
        WebdavException - if something goes wrong on the store level
      • getStoredObject

        StoredObject getStoredObject​(Transaction transaction,
                                     String uri)
        Gets the storedObject specified by uri
        Parameters:
        transaction - indicates that the method is within the scope of a WebDAV transaction
        uri - URI
        Returns:
        StoredObject