-
public interface DownloadServiceDownloadServiceservice allows an application to control how its own resources are cached, to determine which of its resources are currently cached, to force resources to be cached, and to remove resources from the cache. The JNLP Client is responsible for providing a specific implementation of this service.- Since:
- 1.4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DownloadServiceListenergetDefaultProgressWindow()Return a defaultDownloadServiceListenerimplementation which, when passed to aloadmethod, should pop up and update a progress window as the load progresses.booleanisExtensionPartCached(URL ref, String version, String part)Returnstrueif the given part of the given extension is cached, and the extension and part are mentioned in the JNLP file for the application.booleanisExtensionPartCached(URL ref, String version, String[] parts)Returnstrueif the given parts of the given extension are cached, and the extension and parts are mentioned in the JNLP file for the application.booleanisPartCached(String part)Returnstrueif the part referred to by the given string is cached, and that part is mentioned in the JNLP file for the application.booleanisPartCached(String[] parts)Returnstrueif the parts referred to by the given array are cached, and those parts are mentioned in the JNLP file for the application.booleanisResourceCached(URL ref, String version)Returnstrueif the resource referred to by the given URL and version is cached, and that resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or the calling application has been granted all-permissions. .voidloadExtensionPart(URL ref, String version, String[] parts, DownloadServiceListener progress)Downloads the given parts of the given extension, if the parts and the extension are mentioned in the JNLP file for the application.voidloadExtensionPart(URL ref, String version, String part, DownloadServiceListener progress)Downloads the given part of the given extension, if the part and the extension are mentioned in the JNLP file for the application.voidloadPart(String[] parts, DownloadServiceListener progress)Downloads the given parts, if the parts are mentioned in the JNLP file for the application.voidloadPart(String part, DownloadServiceListener progress)Downloads the given part, if the part is mentioned in the JNLP file for the application.voidloadResource(URL ref, String version, DownloadServiceListener progress)Downloads the given resource, if the resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or if the calling application has been granted all-permissions.voidremoveExtensionPart(URL ref, String version, String part)Removes the given part of the given extension from the cache, if the part and the extension are mentioned in the JNLP file for the application.voidremoveExtensionPart(URL ref, String version, String[] parts)Removes the given parts of the given extension from the cache, if the parts and the extension are mentioned in the JNLP file for the application.voidremovePart(String part)Removes the given part from the cache, if the part is mentioned in the JNLP file for the application.voidremovePart(String[] parts)Removes the given parts from the cache, if the parts are mentioned in the JNLP file for the application.voidremoveResource(URL ref, String version)Removes the given resource from the cache, if the resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or if the calling application has been granted all-permissions.
-
-
-
Method Detail
-
isResourceCached
boolean isResourceCached(URL ref, String version)
Returnstrueif the resource referred to by the given URL and version is cached, and that resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or the calling application has been granted all-permissions. .- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.- Returns:
trueif the above conditions are met, andfalseotherwise.
-
isPartCached
boolean isPartCached(String part)
Returnstrueif the part referred to by the given string is cached, and that part is mentioned in the JNLP file for the application.- Parameters:
part- The name of the part.- Returns:
trueif the above conditions are met, andfalseotherwise.
-
isPartCached
boolean isPartCached(String[] parts)
Returnstrueif the parts referred to by the given array are cached, and those parts are mentioned in the JNLP file for the application.- Parameters:
parts- An array of part names.- Returns:
trueif the above conditions are met, andfalseotherwise.
-
isExtensionPartCached
boolean isExtensionPartCached(URL ref, String version, String part)
Returnstrueif the given part of the given extension is cached, and the extension and part are mentioned in the JNLP file for the application.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.part- The name of the part.- Returns:
trueif the above conditions are met, andfalseotherwise.
-
isExtensionPartCached
boolean isExtensionPartCached(URL ref, String version, String[] parts)
Returnstrueif the given parts of the given extension are cached, and the extension and parts are mentioned in the JNLP file for the application.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.parts- An array of part names.- Returns:
trueif the above conditions are met, andfalseotherwise.
-
loadResource
void loadResource(URL ref, String version, DownloadServiceListener progress) throws IOException
Downloads the given resource, if the resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or if the calling application has been granted all-permissions. This method will block until the download is completed or an exception occurs.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.progress- Download progress callback object.- Throws:
IOException- if an I/O error occurs
-
loadPart
void loadPart(String part, DownloadServiceListener progress) throws IOException
Downloads the given part, if the part is mentioned in the JNLP file for the application. This method will block until the download is completed or an exception occurs.- Parameters:
part- The name of the part.progress- Download progress callback object.- Throws:
IOException- if an I/O error occurs
-
loadPart
void loadPart(String[] parts, DownloadServiceListener progress) throws IOException
Downloads the given parts, if the parts are mentioned in the JNLP file for the application. This method will block until the download is completed or an exception occurs.- Parameters:
parts- An array of part names.progress- Download progress callback object.- Throws:
IOException- if an I/O error occurs
-
loadExtensionPart
void loadExtensionPart(URL ref, String version, String part, DownloadServiceListener progress) throws IOException
Downloads the given part of the given extension, if the part and the extension are mentioned in the JNLP file for the application. This method will block until the download is completed or an exception occurs.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.part- The name of the part.progress- Download progress callback object.- Throws:
IOException- if an I/O error occurs
-
loadExtensionPart
void loadExtensionPart(URL ref, String version, String[] parts, DownloadServiceListener progress) throws IOException
Downloads the given parts of the given extension, if the parts and the extension are mentioned in the JNLP file for the application. This method will block until the download is completed or an exception occurs.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.parts- An array of part names to load.progress- Download progress callback object.- Throws:
IOException- if an I/O error occurs
-
removeResource
void removeResource(URL ref, String version) throws IOException
Removes the given resource from the cache, if the resource is either mentioned in the calling applications JNLP file, is within the codebase of the calling applications JNLP file, or if the calling application has been granted all-permissions.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.- Throws:
IOException- if an I/O error occurs
-
removePart
void removePart(String part) throws IOException
Removes the given part from the cache, if the part is mentioned in the JNLP file for the application.- Parameters:
part- The name of the part.- Throws:
IOException- if an I/O error occurs
-
removePart
void removePart(String[] parts) throws IOException
Removes the given parts from the cache, if the parts are mentioned in the JNLP file for the application.- Parameters:
parts- An array of part names.- Throws:
IOException- if an I/O error occurs
-
removeExtensionPart
void removeExtensionPart(URL ref, String version, String part) throws IOException
Removes the given part of the given extension from the cache, if the part and the extension are mentioned in the JNLP file for the application.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.part- The name of the part.- Throws:
IOException- if an I/O error occurs
-
removeExtensionPart
void removeExtensionPart(URL ref, String version, String[] parts) throws IOException
Removes the given parts of the given extension from the cache, if the parts and the extension are mentioned in the JNLP file for the application.- Parameters:
ref- The URL for the resource.version- The version string, ornullfor no version.parts- An array of part names.- Throws:
IOException- if an I/O error occurs
-
getDefaultProgressWindow
DownloadServiceListener getDefaultProgressWindow()
Return a defaultDownloadServiceListenerimplementation which, when passed to aloadmethod, should pop up and update a progress window as the load progresses.- Returns:
- A
DownloadServiceListenerobject representing a download progress listener.
-
-