Class DownloadManager
- java.lang.Object
-
- com.blackberry.workspaces.sdk.api.DownloadManager
-
public class DownloadManager extends Object
DownloadManager
-
-
Constructor Summary
Constructors Constructor Description DownloadManager(APISession session)
DownloadManager Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDownloadManagerEventListener(IDownloadManagerEvent listener)
addDownloadManagerEventListener Method for IDownloadManagerEvent classes to register themselvesvoid
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 IDvoid
downloadFileByName(int roomId, String folderPath, String docName, String destinationPath, String destinationDocName, Date lastUpdateTime)
Download the best possible format of the document with the given IDbyte[]
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()
getKilllong
getRemainingBytes()
Remaining bytesBulkOperationResultJson
initCacheLoad(String docId, int roomId)
Queue cache load for the given document from external repository WSBulkOperationResultJson
initPdfConversion(String docId)
Queue PDF conversion for the given documentvoid
setKill()
setKillvoid
setRemainingBytes(long m_TotalRemaining)
setRemainingBytes
-
-
-
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 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 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 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 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 filesdocPath
- 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 downloadeddestinationPath
- Destination pathdocName
- 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 downloadeddt
- 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
-
-