Interface WebdavRepository

    • Method Detail

      • createAttachmentNode

        void createAttachmentNode​(javax.jcr.Session session,
                                  SimpleDocument attachment)
                           throws javax.jcr.RepositoryException,
                                  IOException
        Create a new node for the specified attachment so that the file may be accessed through webdav. For an attachment, it can exist in webdav one, and only one, content language of the attachment.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Throws:
        javax.jcr.RepositoryException
        IOException
      • deleteAttachmentNode

        void deleteAttachmentNode​(javax.jcr.Session session,
                                  SimpleDocument attachment)
                           throws javax.jcr.RepositoryException
        Delete the node associated to the specified attachment. All contents will be removed. If a specific content (language) must be removed, then use deleteAttachmentContentNode(Session, SimpleDocument, String) method.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Throws:
        javax.jcr.RepositoryException
      • deleteAttachmentContentNode

        void deleteAttachmentContentNode​(javax.jcr.Session session,
                                         SimpleDocument attachment,
                                         String language)
                                  throws javax.jcr.RepositoryException
        Delete the node associated to the specified language content attachment.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        language - the aimed language content to delete.
        Throws:
        javax.jcr.RepositoryException
      • updateAttachmentBinaryContent

        void updateAttachmentBinaryContent​(javax.jcr.Session session,
                                           SimpleDocument attachment)
                                    throws javax.jcr.RepositoryException,
                                           IOException
        Update the file content of the specified attachment without modifying its metadata.
        Parameters:
        session - the JCR session.
        attachment - the attachment for which the file content will be updated with the ralated webdav content.
        Throws:
        javax.jcr.RepositoryException
        IOException
      • updateNodeAttachment

        void updateNodeAttachment​(javax.jcr.Session session,
                                  SimpleDocument attachment)
                           throws javax.jcr.RepositoryException,
                                  IOException
        Update the node using the SimpleDocument. For an attachment, it can exist in webdav one, and only one, content language of the attachment.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Throws:
        javax.jcr.RepositoryException
        IOException
      • moveNodeAttachment

        void moveNodeAttachment​(javax.jcr.Session session,
                                SimpleDocument attachment,
                                String targetComponentInstanceId)
                         throws javax.jcr.RepositoryException,
                                IOException
        Move the specified attachment to the specified component instance id.
        Parameters:
        session - the JCR session.
        attachment - the attachment to move to another component instance identifier.
        targetComponentInstanceId - the identifier of the target component instance.
        Throws:
        javax.jcr.RepositoryException
        IOException
      • isNodeLocked

        boolean isNodeLocked​(javax.jcr.Session session,
                             SimpleDocument attachment)
                      throws javax.jcr.RepositoryException
        Indicate if the node for the specified attachment is currently locked (for example by Office in the case of a webdav online edition).
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Returns:
        true if the node is locked - false otherwise.
        Throws:
        javax.jcr.RepositoryException
      • getContentEditionLanguage

        String getContentEditionLanguage​(javax.jcr.Session session,
                                         SimpleDocument attachment)
                                  throws javax.jcr.RepositoryException
        Gets the current content edition language of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Returns:
        the content edition language if the specified attachment exists in the webdav repository, null otherwise.
        Throws:
        javax.jcr.RepositoryException
      • getContentEditionSize

        long getContentEditionSize​(javax.jcr.Session session,
                                   SimpleDocument attachment)
                            throws javax.jcr.RepositoryException
        Gets the current content edition size of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Returns:
        the content edition size if the specified attachment exists in the webdav repository, -1 otherwise.
        Throws:
        javax.jcr.RepositoryException
      • getDescriptor

        Optional<WebdavContentDescriptor> getDescriptor​(javax.jcr.Session session,
                                                        SimpleDocument attachment)
                                                 throws javax.jcr.RepositoryException
        Gets the current webdav descriptor of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.
        Parameters:
        session - the JCR session.
        attachment - the attachment.
        Returns:
        the optional content edition webdav descriptor if the specified attachment exists in the webdav repository.
        Throws:
        javax.jcr.RepositoryException - on JCR access error.
      • updateContentFrom

        void updateContentFrom​(javax.jcr.Session session,
                               SimpleDocument document,
                               InputStream input)
                        throws javax.jcr.RepositoryException,
                               IOException
        Updates a document content into the WEBDAV repository.

        If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.

        Parameters:
        session - the JCR session.
        document - the aimed document.
        input - the data to write.
        Throws:
        javax.jcr.RepositoryException
        IOException
      • loadContentInto

        void loadContentInto​(javax.jcr.Session session,
                             SimpleDocument document,
                             OutputStream output)
                      throws javax.jcr.RepositoryException,
                             IOException
        Reads a document content from the WEBDAV repository and writes it into given output.

        If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.

        Parameters:
        session - the JCR session.
        document - the aimed document.
        output - the stream to write into.
        Throws:
        javax.jcr.RepositoryException
        IOException