Class JNLPFileFactory


  • public class JNLPFileFactory
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Random random  
    • Constructor Summary

      Constructors 
      Constructor Description
      JNLPFileFactory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JNLPFile create​(java.net.URL location)
      Create a JNLPFile from a URL.
      JNLPFile create​(java.net.URL location, java.lang.String uniqueKey, VersionString version, ParserSettings settings, UpdatePolicy policy)
      Create a JNLPFile from a URL, parent URLm a version and checking for updates using the specified policy.
      JNLPFile create​(java.net.URL location, VersionString version)
      Create a JNLPFile from a URL and version and checking for updates using the default policy.
      JNLPFile create​(java.net.URL location, ParserSettings settings)
      Create a JNLPFile from a URL checking for updates using the default policy.
      private java.lang.String createUniqueKey​(java.net.URL location)
      Generate unique key from file URL
      private java.io.InputStream openURL​(java.net.URL location, VersionString version, UpdatePolicy policy)
      Open the jnlp file URL from the cache if there, otherwise download to the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • random

        private java.util.Random random
    • Constructor Detail

      • JNLPFileFactory

        public JNLPFileFactory()
    • Method Detail

      • create

        public JNLPFile create​(java.net.URL location)
                        throws java.io.IOException,
                               ParseException
        Create a JNLPFile from a URL.
        Parameters:
        location - the location of the JNLP file
        Throws:
        java.io.IOException - if an IO exception occurred
        ParseException - if the JNLP file was invalid
      • createUniqueKey

        private java.lang.String createUniqueKey​(java.net.URL location)
        Generate unique key from file URL
        Parameters:
        location -
      • create

        public JNLPFile create​(java.net.URL location,
                               VersionString version)
                        throws java.io.IOException,
                               ParseException
        Create a JNLPFile from a URL and version and checking for updates using the default policy.
        Parameters:
        location - the location of the JNLP file
        version - the version of the JNLP file
        Throws:
        java.io.IOException - if an IO exception occurred
        ParseException - if the JNLP file was invalid
      • create

        public JNLPFile create​(java.net.URL location,
                               ParserSettings settings)
                        throws java.io.IOException,
                               ParseException
        Create a JNLPFile from a URL checking for updates using the default policy.
        Parameters:
        location - the location of the JNLP file
        settings - the parser settings to use while parsing the file
        Throws:
        java.io.IOException - if an IO exception occurred
        ParseException - if the JNLP file was invalid
      • create

        public JNLPFile create​(java.net.URL location,
                               java.lang.String uniqueKey,
                               VersionString version,
                               ParserSettings settings,
                               UpdatePolicy policy)
                        throws java.io.IOException,
                               ParseException
        Create a JNLPFile from a URL, parent URLm a version and checking for updates using the specified policy.
        Parameters:
        location - the location of the JNLP file
        uniqueKey - A string that uniquely identifies connected instances
        version - the version of the JNLP file
        settings - the parser settings to use while parsing the file
        policy - the update policy
        Throws:
        java.io.IOException - if an IO exception occurred
        ParseException - if the JNLP file was invalid
      • openURL

        private java.io.InputStream openURL​(java.net.URL location,
                                            VersionString version,
                                            UpdatePolicy policy)
                                     throws java.io.IOException
        Open the jnlp file URL from the cache if there, otherwise download to the cache. Unless file is up-to-date in cache, this method blocks until it is downloaded.
        Parameters:
        location - of resource to open
        version - of resource
        policy - update policy of resource
        Returns:
        opened stream from given url
        Throws:
        java.io.IOException - if something goes wrong