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, skip
public DownloadStream(IOFileDownstreamConnection strConn) throws java.io.IOException
java.io.IOException
public void cancel()
LocalCancellableTask
CancellableTask.wasCancelled()
will return true. Actually this call cancels the
task's current Future
and enforces a CancellationException
to be thrown.cancel
in interface LocalCancellableTask
public boolean wasCancelled()
CancellableTask
wasCancelled
in interface CancellableTask
public TaskId getTaskId()
TaskIdHolder
TaskId
.getTaskId
in interface TaskIdHolder
public 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.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.BufferedInputStream
java.io.IOException
protected void fireProgress(java.lang.Object result, long percentage, java.lang.String progressMsg)
fireProgress
in class ProgressInputStream
public java.lang.String toString()
toString
in class java.lang.Object
public java.awt.Color getRenderColor()
getRenderColor
in interface Renderable
public javax.swing.Icon getRenderIcon()
getRenderIcon
in interface Renderable
public java.lang.String getRenderText()
getRenderText
in interface Renderable
Copyright © 2014 EsprIT-Systems. All Rights Reserved.