Interface DocumentStorageService

  • All Known Implementing Classes:
    DocumentStorageServiceImpl

    public interface DocumentStorageService
    Simple storage service definition
    • Method Detail

      • buildDocument

        Document buildDocument​(String name,
                               long size,
                               Date lastModified,
                               Map<String,​String> params)
        Generates a Document instance.
        Parameters:
        name - The document name
        size - The document size
        lastModified - The lastModified date of the document
        params - A Map containing the params to create the document.
        Returns:
      • saveDocument

        Document saveDocument​(Document document,
                              byte[] content)
        Method to store the uploaded file on the system
        Parameters:
        document - The document to store the content
        content - The document content
        Returns:
        A Document
      • getDocument

        Document getDocument​(String id)
        Method to obtain a File for the given storage id
        Parameters:
        id - The Document id to obtain the Document
        Returns:
        The java.io.File identified with the id
      • loadContent

        byte[] loadContent​(String id)
        Loads document content
        Parameters:
        id - unique id of the document
        Returns:
        loaded document's content
      • deleteDocument

        boolean deleteDocument​(String id)
        Deletes the File identified by the given id
        Parameters:
        id - The Document id to delete
        Returns:
        true if it was possible to remove, false if not
      • deleteDocument

        boolean deleteDocument​(Document document)
        Deletes the File identified by the given id
        Parameters:
        document - The Document to delete
        Returns:
        true if it was possible to remove, false if not
      • listDocuments

        List<Document> listDocuments​(Integer page,
                                     Integer pageSize)
        Lists available document with paging support.
        Parameters:
        page - page to be displayed
        pageSize - number of elements to return
        Returns: