-
public interface DownloadServiceListenerTheDownloadServiceListenerprovides an interface for a callback object implementation, which may be used by a DownloadService implementation. TheDownloadServiceListenerimplementation's methods should be invoked by theDownloadServiceimplementation at various stages of the download, allowing an application that uses the JNLP API to display a progress bar during aDownloadServicedownload.- Since:
- 1.4.2
- See Also:
DownloadService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddownloadFailed(URL url, String version)A JNLP client'sDownloadServiceimplementation should call this method if a download fails or aborts unexpectedly.voidprogress(URL url, String version, long readSoFar, long total, int overallPercent)A JNLP client'sDownloadServiceimplementation should call this method several times during a download.voidupgradingArchive(URL url, String version, int patchPercent, int overallPercent)A JNLP client'sDownloadServiceimplementation should call this method at least several times when applying an incremental update to an in-cache resource.voidvalidating(URL url, String version, long entry, long total, int overallPercent)A JNLP client'sDownloadServiceimplementation should call this method at least several times during validation of a download.
-
-
-
Method Detail
-
progress
void progress(URL url, String version, long readSoFar, long total, int overallPercent)
A JNLP client'sDownloadServiceimplementation should call this method several times during a download. ADownloadServiceListenerimplementation may display a progress bar and / or update information based on the parameters.- Parameters:
url- The URL representing the resource being downloaded.version- The version of the resource being downloaded.readSoFar- The number of bytes downloaded so far.total- The total number of bytes to be downloaded, or -1 if the number is unknown.overallPercent- The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.
-
validating
void validating(URL url, String version, long entry, long total, int overallPercent)
A JNLP client'sDownloadServiceimplementation should call this method at least several times during validation of a download. Validation often includes ensuring that downloaded resources are authentic (appropriately signed). ADownloadServiceListenerimplementation may display a progress bar and / or update information based on the parameters.- Parameters:
url- The URL representing the resource being validated.version- The version of the resource being validated.entry- The number of JAR entries validated so far.total- The total number of entries to be validated.overallPercent- The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.
-
upgradingArchive
void upgradingArchive(URL url, String version, int patchPercent, int overallPercent)
A JNLP client'sDownloadServiceimplementation should call this method at least several times when applying an incremental update to an in-cache resource. ADownloadServiceListenerimplementation may display a progress bar and / or update information based on the parameters.- Parameters:
url- The URL representing the resource being patched.version- The version of the resource being patched.patchPercent- The percentage of the patch operation that is complete, or -1 if the percentage is unknown.overallPercent- The percentage of the overall update operation that is complete, or -1 if the percentage is unknown.
-
downloadFailed
void downloadFailed(URL url, String version)
A JNLP client'sDownloadServiceimplementation should call this method if a download fails or aborts unexpectedly. In response, aDownloadServiceListenerimplementation may display update information to the user to reflect this.- Parameters:
url- The URL representing the resource for which the download failed.version- The version of the resource for which the download failed.
-
-