Interface ExternalDownloadService


public interface ExternalDownloadService
  • Method Details

    • getDocumentDownloadItem

      DownloadItem getDocumentDownloadItem(String documentId)
      Gets a download item of a given document
      Parameters:
      documentId - document id
      Returns:
      DownloadItem
    • downloadZippedFolder

      InputStream downloadZippedFolder(String folderId) throws IOException, org.exoplatform.commons.exception.ObjectNotFoundException
      Download a zipped folder shared by a public link, with the rights of the user who created the link, evaluated when this method runs: what that user cannot read, a sub-folder, a document or a shortcut target, is left out of the zip.
      Parameters:
      folderId - id of the folder holding the public link
      Returns:
      the zipped folder, read from a file of its own that closing the stream deletes: the caller closes it
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the folder has no public link, the link records no creator, the creator is unknown, deleted or disabled, or the creator cannot read the folder
      IOException - when the zip cannot be built or read
    • checkDocumentDownload

      void checkDocumentDownload(String documentId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Checks that the document of a public link can be downloaded as getDocumentDownloadItem(String) and downloadZippedFolder(String) would serve it, without reading the document or building a folder's zip
      Parameters:
      documentId - the link's document id
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when no document has this id, or, for a folder, when its link records no active creator or the creator cannot read it