Module java.jnlp
Package javax.jnlp

Interface DownloadService



  • public interface DownloadService
    DownloadService service 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
      DownloadServiceListener getDefaultProgressWindow​()
      Return a default DownloadServiceListener implementation which, when passed to a load method, should pop up and update a progress window as the load progresses.
      boolean isExtensionPartCached​(URL ref, String version, String part)
      Returns true if the given part of the given extension is cached, and the extension and part are mentioned in the JNLP file for the application.
      boolean isExtensionPartCached​(URL ref, String version, String[] parts)
      Returns true if the given parts of the given extension are cached, and the extension and parts are mentioned in the JNLP file for the application.
      boolean isPartCached​(String part)
      Returns true if the part referred to by the given string is cached, and that part is mentioned in the JNLP file for the application.
      boolean isPartCached​(String[] parts)
      Returns true if the parts referred to by the given array are cached, and those parts are mentioned in the JNLP file for the application.
      boolean isResourceCached​(URL ref, String version)
      Returns true if 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. .
      void loadExtensionPart​(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.
      void loadExtensionPart​(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.
      void loadPart​(String[] parts, DownloadServiceListener progress)
      Downloads the given parts, if the parts are mentioned in the JNLP file for the application.
      void loadPart​(String part, DownloadServiceListener progress)
      Downloads the given part, if the part is mentioned in the JNLP file for the application.
      void loadResource​(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.
      void removeExtensionPart​(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.
      void removeExtensionPart​(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.
      void removePart​(String part)
      Removes the given part from the cache, if the part is mentioned in the JNLP file for the application.
      void removePart​(String[] parts)
      Removes the given parts from the cache, if the parts are mentioned in the JNLP file for the application.
      void removeResource​(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)
        Returns true if 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, or null for no version.
        Returns:
        true if the above conditions are met, and false otherwise.
      • isPartCached

        boolean isPartCached​(String part)
        Returns true if 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:
        true if the above conditions are met, and false otherwise.
      • isPartCached

        boolean isPartCached​(String[] parts)
        Returns true if 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:
        true if the above conditions are met, and false otherwise.
      • isExtensionPartCached

        boolean isExtensionPartCached​(URL ref,
                                      String version,
                                      String part)
        Returns true if 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, or null for no version.
        part - The name of the part.
        Returns:
        true if the above conditions are met, and false otherwise.
      • isExtensionPartCached

        boolean isExtensionPartCached​(URL ref,
                                      String version,
                                      String[] parts)
        Returns true if 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, or null for no version.
        parts - An array of part names.
        Returns:
        true if the above conditions are met, and false otherwise.
      • 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, or null for 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, or null for 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, or null for 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, or null for 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, or null for 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, or null for no version.
        parts - An array of part names.
        Throws:
        IOException - if an I/O error occurs
      • getDefaultProgressWindow

        DownloadServiceListener getDefaultProgressWindow​()
        Return a default DownloadServiceListener implementation which, when passed to a load method, should pop up and update a progress window as the load progresses.
        Returns:
        A DownloadServiceListener object representing a download progress listener.