| com.sun.jump.module.download.JUMPDownloadDestination
All known Subclasses: com.sun.jumpimpl.module.download.DownloadDestinationImpl,
JUMPDownloadDestination | public interface JUMPDownloadDestination (Code) | | JUMPDownloadDestination provides the interface to
receive the data that is downloaded by the JUMPDownloadAction .
The start() is called first before the download operation
and if not exceptions are thrown by the method, then the
receive() method is called one or more times as the
downloading of data happens. Finally the finish() method
is called if the data has been successfully downloaded and delivered to
the destination or the abort() method is called if the
download operation was aborted by the user or the system.
|
Method Summary | |
public void | abort() Notifies the destination that the object acquisition has
failed or was stopped. | public URL | finish() Notifies the destination that the object download is done. | public int | getMaxChunkSize() Asks the destination what's the maximum buffer size should
be used for downloading. | public int | receive(InputStream in, int desiredLength) Requests this destination to receive a part of the object
being downloaded.
Parameters: in - The InputStream to read from Parameters: desiredLength - The number of bytes to receive the total number of bytes read, or -1 isthere is no more data because the end of the stream has beenreached. throws: JUMPDJUMPDownloadExceptionis - at implemntation's discretionto throw an JUMPDJUMPDownloadExceptionanything goes wrong. | public void | start(URL sourceURL, String mimeType) Notifies the destination the download is about to start.
Parameters: sourceURL - source URL Parameters: mimeType - mime type of the object to be sent tothis destination. throws: JUMPJUMPDownloadException - is at implemntation's discretionto throw an JUMPJUMPDownloadException anything goes wrong. |
abort | public void abort()(Code) | | Notifies the destination that the object acquisition has
failed or was stopped. There will be no more bits sent, and the
JUMPDownloadDestination.finish() method will not be called.
|
finish | public URL finish() throws JUMPDownloadException, IOException(Code) | | Notifies the destination that the object download is done. If the
destination has successfully stored the data, it returns the URL
where the destination has stored the application content.
the URL of the application content that was downloaded. throws: JUMPJUMPDownloadException - is at implemntation's discretionto throw an JUMPJUMPDownloadException anything goes wrong. The downloadwill be cancelled and this exception will be bubbled up. throws: IOException - signal that there was an IO error. |
getMaxChunkSize | public int getMaxChunkSize()(Code) | | Asks the destination what's the maximum buffer size should
be used for downloading.
maximum buffer size to be used for downloading, or 0,to let the implementation decide what's best.
|
receive | public int receive(InputStream in, int desiredLength) throws JUMPDownloadException, IOException(Code) | | Requests this destination to receive a part of the object
being downloaded.
Parameters: in - The InputStream to read from Parameters: desiredLength - The number of bytes to receive the total number of bytes read, or -1 isthere is no more data because the end of the stream has beenreached. throws: JUMPDJUMPDownloadExceptionis - at implemntation's discretionto throw an JUMPDJUMPDownloadExceptionanything goes wrong. The downloadwill be cancelled and this exception will be bubbled up. throws: IOException - signal that there was an IO error. |
start | public void start(URL sourceURL, String mimeType) throws JUMPDownloadException, IOException(Code) | | Notifies the destination the download is about to start.
Parameters: sourceURL - source URL Parameters: mimeType - mime type of the object to be sent tothis destination. throws: JUMPJUMPDownloadException - is at implemntation's discretionto throw an JUMPJUMPDownloadException anything goes wrong. The downloadwill be cancelled and this exception will be bubbled up. throws: IOException - signal that there was an IO error. |
|
|