public class DownloadManager extends Object
Constructor and Description |
---|
DownloadManager(APISession session)
DownloadManager Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDownloadManagerEventListener(IDownloadManagerEvent listener)
addDownloadManagerEventListener Method for IDownloadManagerEvent classes to register themselves
|
void |
downloadFileById(String docId,
String name,
int roomId,
String destinationPath,
String destinationDocName,
Date lastUpdateTimeUTC,
boolean createFolderPath,
boolean calcHash,
DownloadTypes dt)
Download the best possible format of the document with the given ID
|
void |
downloadFileByName(int roomId,
String folderPath,
String docName,
String destinationPath,
String destinationDocName,
Date lastUpdateTime)
Download the best possible format of the document with the given ID
|
byte[] |
downloadFileToBuffer(String docId,
DownloadTypes dt)
Download the requested version of the document with the given Id to a memory stream.
|
void |
downloadProtectedFileById(String docId,
String destinationPath,
String destinationDocName)
Download the protected version of the document with the given Id to the destination path.
|
byte[] |
downloadProtectedFileToBuffer(String docId)
Download the protected version of the document with the given Id to a memory stream.
|
String |
getDocIdFromNameRoomPath(int roomId,
String docPath,
String docName)
Get document guid given room, path and name.
|
boolean |
getKill()
getKill
|
long |
getRemainingBytes()
Remaining bytes
|
BulkOperationResultJson |
initCacheLoad(String docId,
int roomId)
Queue cache load for the given document from external repository WS
|
BulkOperationResultJson |
initPdfConversion(String docId)
Queue PDF conversion for the given document
|
void |
setKill()
setKill
|
void |
setRemainingBytes(long m_TotalRemaining)
setRemainingBytes
|
public DownloadManager(APISession session)
session
- public void downloadFileById(String docId, String name, int roomId, String destinationPath, String destinationDocName, Date lastUpdateTimeUTC, boolean createFolderPath, boolean calcHash, DownloadTypes dt) throws IOException
docId
- UUID for the documentname
- Name of the document, for progress reports onlyroomId
- Room ID for the document, for progress reports onlydestinationPath
- Path the file will be written todestinationDocName
- Destination document namelastUpdateTimeUTC
- Time to set as last update date (in UTC) for the documentcreateFolderPath
- Indicates whether the complete path should be created if it doesn't exist, before downloading the
file.calcHash
- dt
- type of protection to askIOException
public void downloadFileByName(int roomId, String folderPath, String docName, String destinationPath, String destinationDocName, Date lastUpdateTime) throws IOException
roomId
- Room ID for the document, for progress reports onlyfolderPath
- folder path after the root of the roomdocName
- Name of the document, for progress reports onlydestinationPath
- Path the file will be written todestinationDocName
- Destination document namelastUpdateTime
- Time to set as last update date for the documentIOException
public String getDocIdFromNameRoomPath(int roomId, String docPath, String docName)
roomId
- Room ID for workspace containing the filesdocPath
- Pathname to file (excluding file name)docName
- File namepublic void downloadProtectedFileById(String docId, String destinationPath, String destinationDocName) throws IOException
docId
- The guid of the file to be downloadeddestinationPath
- Destination pathdocName
- File nameIOException
public byte[] downloadProtectedFileToBuffer(String docId)
docId
- The guid of the file to be downloadedpublic byte[] downloadFileToBuffer(String docId, DownloadTypes dt)
docId
- The guid of the file to be downloadeddt
- Download typepublic BulkOperationResultJson initPdfConversion(String docId)
docId
- public BulkOperationResultJson initCacheLoad(String docId, int roomId)
docId
- roomId
- public long getRemainingBytes()
public void setRemainingBytes(long m_TotalRemaining)
m_TotalRemaining
- public boolean getKill()
public void setKill()
public void addDownloadManagerEventListener(IDownloadManagerEvent listener)
listener
- IDownloadManagerEventCopyright © 2019. All rights reserved.