Package com.iizix.jre

Class ControlPanel

java.lang.Object
com.iizix.jre.ControlPanel

public class ControlPanel extends Object
Handles routines that deals with deployment properties and configuration in the the Java Control Panel.
Author:
Christopher Mindus
  • Constructor Details

    • ControlPanel

      public ControlPanel()
  • Method Details

    • getIPv4Address

      public static byte[] getIPv4Address(String name)
      Gets the IPv4 byte address.
      Returns:
      null if not number address.
    • isLocalhost

      public static boolean isLocalhost(String name)
      Check if it's localhost.
    • useSystemProxies

      public static boolean useSystemProxies()
      Checks if system proxies are used by default.
    • doVerifyServerHostName

      public static boolean doVerifyServerHostName()
      Checks the setting for HTTPS host name verification.
      Returns:
      true if the server host name should be checked, false otherwise.
    • displaySystemProperties

      public static void displaySystemProperties()
      Sorts and displays the system properties.
    • initDeployData

      public static boolean initDeployData(boolean isVerbose)
      Initializes the control panel to load the deployment data.
      Parameters:
      isVerbose - Flag to display verbose output.
      Returns:
      true for success, false for failure.
    • readSystemProxies

      public static void readSystemProxies(boolean isApplet, boolean isVerbose)
      Get a fresh list of the proxies defined.
    • getProxies

      public static ArrayList<Proxy> getProxies(URL url, ArrayList<Proxy> cmdLineProxies, boolean isVerbose)
      Gets the proxies to use for a particular host URL.
    • getTS

      public static String getTS()
      Gets a timestamp string.
    • getByName

      public static InetAddress getByName(String host, boolean isVerbose) throws UnknownHostException
      Determines the IP address of a host, given the host's name.

      The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.

      If the host is null then an InetAddress representing an address of the loop-back interface is returned.

      Parameters:
      host - The specified host, or null.
      isVerbose - Verbose output flag.
      Returns:
      An IP address for the given host name.
      Throws:
      UnknownHostException - if no IP address for the host could be found, or if a scope_id was specified for a global IPv6 address.
    • getAllByName

      public static InetAddress[] getAllByName(String host, boolean isVerbose) throws UnknownHostException
      Given the name of a host, returns an array of its IP addresses, based on the configured name service on the system.

      The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.

      For host specified in literal IPv6 address, either the form defined in RFC 2732 or the literal IPv6 address format defined in RFC 2373 is accepted. A literal IPv6 address may also be qualified by appending a scoped zone identifier or scope_id.

      If the host is null then an InetAddress representing an address of the loop-back interface is returned.

      Parameters:
      host - host - the name of the host, or null.
      isVerbose - Verbose output flag.
      Returns:
      An array of all the IP addresses for a given host name.
      Throws:
      UnknownHostException - if no IP address for the host could be found, or if a scope_id was specified for a global IPv6 address.
    • isLocalAddress

      public static boolean isLocalAddress(String host, boolean isVerbose)
      Checks if it's a local (intranet) host address.
      Parameters:
      host - The host name.
      isVerbose - Verbose output flag.
      Returns:
      true if local intranet host address, false otherwise.
    • getCertificates

      public static HashSet<X509Certificate>[] getCertificates(boolean isVerbose)
      Loads the certificates: CA, JSSE and Trusted Certificates (Code Signing). This method can only be called once the method initDeployData() has been called.
      Returns:
      An array of 3 ArrayList<X509Certificate>. The first list contains the CA certificates, the second, the JSSE trusted certificates, and the third the Trusted (code signing) certificates.
    • getClientCertificatesKeystoreFileNames

      public static String[] getClientCertificatesKeystoreFileNames()
      Gets the file name for the System Client Certificates keystore. This method can only be called once the method initDeployData() has been called.
      Returns:
      The file names for the KeyStore's of System and User, array size of 2. Note: the file might not exist.
    • getDescription

      public static String getDescription(Principal p)
      Formats a Principal entry.
    • getDescription

      public static String getDescription(X509Certificate c)
      Gets the "WHO" string with certificate validity and issuer.
    • getDeploymentClientCertificates

      public static KeyManager[] getDeploymentClientCertificates(ICertificateUI callback, boolean isVerbose)
      Gets the array of client certificates from deployment information.