public class DownloadStream extends ProgressInputStream implements Renderable, LocalCancellableTask
FileStreamDownloadAgent for downloading file data from the server.
Reading the stream is automatically monitored by the client.STREAM_BUFF_SIZE| Constructor and Description |
|---|
DownloadStream(IOFileDownstreamConnection strConn) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the running task.
|
void |
close() |
protected void |
fireProgress(java.lang.Object result,
long percentage,
java.lang.String progressMsg)
Note that the total length of the stream is normed to 100%.
|
AgentId |
getAgentId() |
FileDataType |
getFileDataType() |
JobId |
getJobId() |
long |
getRealFileSize() |
java.awt.Color |
getRenderColor() |
javax.swing.Icon |
getRenderIcon() |
java.lang.String |
getRenderText() |
java.io.File |
getServerFile() |
FileStreamJob |
getStreamJob() |
TaskId |
getTaskId()
Returns the unique identifier for this task.
|
java.lang.String |
toString() |
boolean |
wasCancelled()
Tells whether ever an attempt has been made to cancel this task.
|
getByteCount, getFileInfo, getFireCount, getProgressorTask, getReadPercentage, getTotalBytes, read, read, setProgressorTask, skippublic DownloadStream(IOFileDownstreamConnection strConn) throws java.io.IOException
java.io.IOExceptionpublic void cancel()
LocalCancellableTaskCancellableTask.wasCancelled() will return true. Actually this call cancels the
task's current Future and enforces a CancellationException to be thrown.cancel in interface LocalCancellableTaskpublic boolean wasCancelled()
CancellableTaskwasCancelled in interface CancellableTaskpublic TaskId getTaskId()
TaskIdHolderTaskId.getTaskId in interface TaskIdHolderpublic long getRealFileSize()
public java.io.File getServerFile()
public FileStreamJob getStreamJob()
public FileDataType getFileDataType()
public JobId getJobId()
public AgentId getAgentId()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.BufferedInputStreamjava.io.IOExceptionprotected void fireProgress(java.lang.Object result,
long percentage,
java.lang.String progressMsg)
fireProgress in class ProgressInputStreampublic java.lang.String toString()
toString in class java.lang.Objectpublic java.awt.Color getRenderColor()
getRenderColor in interface Renderablepublic javax.swing.Icon getRenderIcon()
getRenderIcon in interface Renderablepublic java.lang.String getRenderText()
getRenderText in interface RenderableCopyright © 2014 EsprIT-Systems. All Rights Reserved.