|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lastbamboo.common.download.DownloadingFileLauncher
public class DownloadingFileLauncher
Class for tracking parts of the downloading file we can view immediately in order.
| Constructor Summary | |
|---|---|
DownloadingFileLauncher(RandomAccessFile raf,
PriorityBlockingQueue<org.apache.commons.lang.math.LongRange> completedRanges,
URI expectedSha1,
File incompleteFile)
Creates a new tracker for streaming the file to the browser. |
|
| Method Summary | |
|---|---|
int |
getActiveWriteCalls()
Accessor for the number of active writers. |
void |
onDownloadStopped()
Called when a download is stopped. |
void |
onFailure()
Called when a download fails for any reason. |
void |
onFileComplete()
Called when the file download has completed. |
void |
onRangeComplete(org.apache.commons.lang.math.LongRange range)
|
void |
waitForLaunchersToComplete()
Waits until all active launcher have finished their writes, typically to the browser. |
void |
write(OutputStream os,
boolean cancelOnStreamClose)
Writes the file to the specified stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DownloadingFileLauncher(RandomAccessFile raf,
PriorityBlockingQueue<org.apache.commons.lang.math.LongRange> completedRanges,
URI expectedSha1,
File incompleteFile)
raf - The random access file to copy the downloaded data from.completedRanges - The ranges that have already completed
downloading.expectedSha1 - The expected SHA-1 for the file.incompleteFile - The incomplete file on disk.| Method Detail |
|---|
public void onRangeComplete(org.apache.commons.lang.math.LongRange range)
onRangeComplete in interface org.littleshoot.util.LongRangeListenerpublic void onFailure()
LaunchFileTracker
onFailure in interface LaunchFileTracker
public void write(OutputStream os,
boolean cancelOnStreamClose)
throws IOException
LaunchFileTracker
write in interface LaunchFileTrackeros - The stream to write to.
IOException - If there's any read or write error writing to the
stream.public void onFileComplete()
LaunchFileTracker
onFileComplete in interface LaunchFileTrackerpublic int getActiveWriteCalls()
LaunchFileTracker
getActiveWriteCalls in interface LaunchFileTrackerpublic void waitForLaunchersToComplete()
LaunchFileTracker
waitForLaunchersToComplete in interface LaunchFileTrackerpublic void onDownloadStopped()
LaunchFileTracker
onDownloadStopped in interface LaunchFileTracker
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||