Class DownloadManager


  • public class DownloadManager
    extends Object
    DownloadManager
    • Constructor Detail

      • DownloadManager

        public DownloadManager​(APISession session)
        DownloadManager Constructor
        Parameters:
        session -
    • Method Detail

      • downloadFileById

        public void downloadFileById​(String docId,
                                     String name,
                                     int roomId,
                                     String destinationPath,
                                     String destinationDocName,
                                     Date lastUpdateTimeUTC,
                                     boolean createFolderPath,
                                     boolean calcHash,
                                     DownloadTypes dt)
                              throws IOException
        Download the best possible format of the document with the given ID
        Parameters:
        docId - UUID for the document
        name - Name of the document, for progress reports only
        roomId - Room ID for the document, for progress reports only
        destinationPath - Path the file will be written to
        destinationDocName - Destination document name
        lastUpdateTimeUTC - Time to set as last update date (in UTC) for the document
        createFolderPath - Indicates whether the complete path should be created if it doesn't exist, before downloading the file.
        calcHash -
        dt - type of protection to ask
        Throws:
        IOException
      • downloadFileByName

        public void downloadFileByName​(int roomId,
                                       String folderPath,
                                       String docName,
                                       String destinationPath,
                                       String destinationDocName,
                                       Date lastUpdateTime)
                                throws IOException
        Download the best possible format of the document with the given ID
        Parameters:
        roomId - Room ID for the document, for progress reports only
        folderPath - folder path after the root of the room
        docName - Name of the document, for progress reports only
        destinationPath - Path the file will be written to
        destinationDocName - Destination document name
        lastUpdateTime - Time to set as last update date for the document
        Throws:
        IOException
      • getDocIdFromNameRoomPath

        public String getDocIdFromNameRoomPath​(int roomId,
                                               String docPath,
                                               String docName)
        Get document guid given room, path and name.
        Parameters:
        roomId - Room ID for workspace containing the files
        docPath - Pathname to file (excluding file name)
        docName - File name
        Returns:
        The Id for the document in the given room, path and name
      • downloadProtectedFileById

        public void downloadProtectedFileById​(String docId,
                                              String destinationPath,
                                              String destinationDocName)
                                       throws IOException
        Download the protected version of the document with the given Id to the destination path.
        Parameters:
        docId - The guid of the file to be downloaded
        destinationPath - Destination path
        docName - File name
        Throws:
        IOException
      • downloadProtectedFileToBuffer

        public byte[] downloadProtectedFileToBuffer​(String docId)
        Download the protected version of the document with the given Id to a memory stream.
        Parameters:
        docId - The guid of the file to be downloaded
        Returns:
        InputStream file data
      • downloadFileToBuffer

        public byte[] downloadFileToBuffer​(String docId,
                                           DownloadTypes dt)
        Download the requested version of the document with the given Id to a memory stream.
        Parameters:
        docId - The guid of the file to be downloaded
        dt - Download type
        Returns:
        InputStream file data
      • initPdfConversion

        public BulkOperationResultJson initPdfConversion​(String docId)
        Queue PDF conversion for the given document
        Parameters:
        docId -
        Returns:
      • initCacheLoad

        public BulkOperationResultJson initCacheLoad​(String docId,
                                                     int roomId)
        Queue cache load for the given document from external repository WS
        Parameters:
        docId -
        roomId -
        Returns:
      • getRemainingBytes

        public long getRemainingBytes()
        Remaining bytes
        Returns:
        total remaining bytes
      • setRemainingBytes

        public void setRemainingBytes​(long m_TotalRemaining)
        setRemainingBytes
        Parameters:
        m_TotalRemaining -
      • getKill

        public boolean getKill()
        getKill
        Returns:
        Returns true if interrupted
      • setKill

        public void setKill()
        setKill
      • addDownloadManagerEventListener

        public void addDownloadManagerEventListener​(IDownloadManagerEvent listener)
        addDownloadManagerEventListener Method for IDownloadManagerEvent classes to register themselves
        Parameters:
        listener - IDownloadManagerEvent