Class UploadManager
java.lang.Object
com.blackberry.workspaces.sdk.api.UploadManager
public class UploadManager extends Object
UploadManager
-
Field Summary
Fields Modifier and Type Field Description String
Hash
Hashstatic String
REMOVE_ALL
REMOVE_ALL -
Constructor Summary
Constructors Constructor Description UploadManager(APISession session)
-
Method Summary
Modifier and Type Method Description void
addUploadManagerEventListener(IUploadManagerEvent listener)
addUploadManagerEventListenerstatic String
EscAddress(String p)
EscAddressvoid
getDocumentIDByName(int roomId, String destinationFileName, String folder, UploadResult uploadResult)
Gets documentID by nameString
getHash()
Gets Hashboolean
getKill()
Gets KillString
getNewGuidForDocument()
Get a new guid for document.String
getNewGuidForTransientDocument(String workspaceUuid)
Get a new guid for a transient documentlong
getRemainingBytes()
getRemainingByteslong
getTotalSent()
Gets Total sentvoid
onProgressChanged(IFileRequestData fileRequestData, long totalBytes, int sentBytes)
onProgressChanged Raises the event for the UI when the upload progress was changedvoid
reportStatus(IFileRequestData fileRequestData, int progress, Enums.UploadStatus status)
reportStatusvoid
setHash(String Hash)
Sets Hashvoid
setKill(boolean m_KillUpload)
Sets Killvoid
setRemainingBytes(long m_TotalRemaining)
setRemainingBytesvoid
setTotalSent(long m_TotalSent)
Sets Total sentvoid
setTotalSize(long m_TotalSize)
Sets Total sizevoid
updateDocumentClassification(int roomId, String guid, String classification)
Updates the classification field for the give documentvoid
updateDocumentGroups(int roomId, String guid, List<String> groups, boolean openForAllRoom)
UpdateDocumentGroupsvoid
updateDocumentTags(int roomID, String docID, TagListJson uploadTags)
Update tags for known document by ID (GUID)UploadResult
uploadDocument(SubmitDocumentSdsJson uploadInfo, String localPath, String tempPath, String filename, String targetID)
Uploads a new file to Exchange.UploadResult
uploadDocumentToRoom(SubmitDocumentsVdrJson uploadInfo, int roomId, String destinationFileName, String filename, String classification, boolean updateMetaDataOnly)
Uploads a new file to the specific workspace.
-
Field Details
-
REMOVE_ALL
REMOVE_ALL- See Also:
- Constant Field Values
-
Hash
Hash
-
-
Constructor Details
-
Method Details
-
EscAddress
EscAddress- Parameters:
p
- Email address- Returns:
- escaped email address
-
getNewGuidForDocument
Get a new guid for document.- Returns:
- a new guid
-
getNewGuidForTransientDocument
Get a new guid for a transient document- Parameters:
workspaceUuid
-- Returns:
- a new guid
-
uploadDocumentToRoom
public UploadResult uploadDocumentToRoom(SubmitDocumentsVdrJson uploadInfo, int roomId, String destinationFileName, String filename, String classification, boolean updateMetaDataOnly)Uploads a new file to the specific workspace. This operation is divided into three different API calls:- Get the document GUID
- Upload and Process the document in server
- Submit the document along with its permissions and location
- Parameters:
uploadInfo
- Information used when submitting filesroomId
- The room ID of the room (workspace) into which the files will be submitted.destinationFileName
- Destination file namefilename
- File nameclassification
- New classification to setupdateMetaDataOnly
- True if to update meta data- Returns:
- Uploads result
-
uploadDocument
public UploadResult uploadDocument(SubmitDocumentSdsJson uploadInfo, String localPath, String tempPath, String filename, String targetID)Uploads a new file to Exchange. This operation is divided into three different API calls:- Get the document GUID
- Upload and Process the document in server
- Submit the document along with its permissions and location
- Parameters:
uploadInfo
- Information needed when submitting files in SDS mode (not to a workspace).localPath
- Local path of the filetempPath
- Temporary pathfilename
- File nametargetID
- ID of specific document to upload new version- Returns:
- Upload result
-
getDocumentIDByName
public void getDocumentIDByName(int roomId, String destinationFileName, String folder, UploadResult uploadResult)Gets documentID by name- Parameters:
roomId
- Room ID for workspace containing the filesdestinationFileName
- File namefolder
- Pathname to file (excluding file name)uploadResult
- Uploads result
-
updateDocumentTags
Update tags for known document by ID (GUID)- Parameters:
roomID
- room id of the documentdocID
- document GUIDuploadTags
- tags collection
-
updateDocumentClassification
Updates the classification field for the give document- Parameters:
roomId
- The document's workspace room IDguid
- The document's IDclassification
- New classification to set
-
updateDocumentGroups
public void updateDocumentGroups(int roomId, String guid, List<String> groups, boolean openForAllRoom)UpdateDocumentGroups- Parameters:
roomId
- The room ID of the room (workspace)guid
- Document guidgroups
- List of groupsopenForAllRoom
- True if the room is open for all; otherwise false
-
getRemainingBytes
public long getRemainingBytes()getRemainingBytes- Returns:
-
setRemainingBytes
public void setRemainingBytes(long m_TotalRemaining)setRemainingBytes- Parameters:
m_TotalRemaining
-
-
setTotalSize
public void setTotalSize(long m_TotalSize)Sets Total size- Parameters:
m_TotalSize
-
-
getTotalSent
public long getTotalSent()Gets Total sent- Returns:
- m_TotalSent
-
setTotalSent
public void setTotalSent(long m_TotalSent)Sets Total sent- Parameters:
m_TotalSent
-
-
getKill
public boolean getKill()Gets Kill- Returns:
- m_KillUpload
-
setKill
public void setKill(boolean m_KillUpload)Sets Kill- Parameters:
m_KillUpload
-
-
setHash
Sets Hash- Parameters:
Hash
-
-
getHash
Gets Hash- Returns:
- Hash
-
addUploadManagerEventListener
addUploadManagerEventListener- Parameters:
listener
- IUploadManagerEvent
-
reportStatus
public void reportStatus(IFileRequestData fileRequestData, int progress, Enums.UploadStatus status)reportStatus- Parameters:
fileRequestData
-progress
-status
-
-
onProgressChanged
onProgressChanged Raises the event for the UI when the upload progress was changed- Parameters:
fileRequestData
-totalBytes
-sentBytes
-
-