public class FileTransferManager extends Object
| Constructor and Description |
|---|
FileTransferManager(ProjectId projectId,
Usersession usersession)
Constructor that creates a file transfer manager when no project space is available.
|
FileTransferManager(ProjectSpaceBase projectSpaceImpl)
Constructor that creates a file transfer manager for a specific project
space.
|
| Modifier and Type | Method and Description |
|---|---|
FileIdentifier |
addFile(File file)
Adds a file to be transferred (uploaded).
|
FileIdentifier |
addFile(File file,
String id)
Adds a file to be transferred (uploaded).
|
void |
cancelPendingUpload(FileIdentifier fileIdentifier)
Cancels a pending upload.
|
FileDownloadStatus |
getFile(FileIdentifier fileIdentifier,
boolean isTriggeredByUI)
Returns the download status of the file that is associated with the given
FileIdentifier. |
FileDownloadStatus |
getFile(FileIdentifier fileIdentifier,
boolean isTriggeredByUI,
boolean forceDownload)
Returns the download status of the file that is associated with the given
FileIdentifier. |
FileInformation |
getFileInfo(FileIdentifier fileIdentifier)
returns a file information object for a specific file identifier.
|
boolean |
hasWaitingUpload(FileIdentifier fileIdentifier)
Return if a specific file is in the pending upload queue.
|
void |
uploadQueuedFiles(org.eclipse.core.runtime.IProgressMonitor progress)
Uploads all files in the commit queue.
|
public FileTransferManager(ProjectSpaceBase projectSpaceImpl)
projectSpaceImpl - the project space to which this transfer manager belongspublic FileTransferManager(ProjectId projectId, Usersession usersession)
projectId - the project idusersession - the usersessionpublic FileIdentifier addFile(File file) throws FileTransferException
file - the file to be transferredFileIdentifier that associates the file with its IDFileTransferException - in case the file is either null, a directory
or does not existpublic FileIdentifier addFile(File file, String id) throws FileTransferException
file - the file to be transferredid - the ID that will be associated with the file being uploadedFileIdentifier that associates the file with its IDFileTransferException - in case the file is either null, a directory
or does not existpublic void uploadQueuedFiles(org.eclipse.core.runtime.IProgressMonitor progress)
progress - progress monitorpublic FileDownloadStatus getFile(FileIdentifier fileIdentifier, boolean isTriggeredByUI, boolean forceDownload) throws FileTransferException
FileIdentifier.fileIdentifier - the file identifier whose download status should be retrievedisTriggeredByUI - whether the download of the file has been triggered by the UIforceDownload - whether to re-fetch the file even, if a file with the same identifier is already present;
set this to true in case you have files, which will be updated but keep the same
identifierFileTransferException - in case the given file identifier is nullpublic FileDownloadStatus getFile(FileIdentifier fileIdentifier, boolean isTriggeredByUI) throws FileTransferException
FileIdentifier.fileIdentifier - the file identifier whose download status should be retrievedisTriggeredByUI - whether the download of the file has been triggered by the UIFileTransferException - in case the given file identifier is nullpublic boolean hasWaitingUpload(FileIdentifier fileIdentifier)
fileIdentifier - the file to be looked uppublic void cancelPendingUpload(FileIdentifier fileIdentifier)
fileIdentifier - the file to be canceledpublic FileInformation getFileInfo(FileIdentifier fileIdentifier)
fileIdentifier - the identifierCopyright © 2017. All rights reserved.