Class ApplicationSignedJARManager


  • public class ApplicationSignedJARManager
    extends Object
    Records information about JARs from an EAR that are used by an app client. Although JARs can be signed by multiple certificates, this class ultimately associates each JAR with at most one alias with which it was signed. (This is typically used by the Java Web Start support to group like-signed JARs into the same generated JNLP. Java Web Start requires that all JARs listed in a single JNLP document be signed by the same cert or be unsigned.) By organizing the signed JARs by the signing alias used for each, we can easily find all JARs signed by a given alias and then list them in the same generated JNLP.

    A client class should instantiate the manager, then invoke addJar any number of times, then invoke aliasToContent to retrieve the map from each alias to the corresponding (relativeURI, StaticContent) pair.

    If an added JAR is already signed by the developer we do not sign it again, but simply add it to the data structures. If an added JAR is not signed we arrange for it to be auto-signed and the signed version will be the one served to Java Web Start requests.

    Author:
    tjquinn
    • Method Detail

      • addJAR

        public URI addJAR​(URI absJARURI)
                   throws IOException
        Adds a JAR to the manager, returning the URI for the file to be served. The URI within the anchor is derived from the absolute URI relative to the EAR's anchor on the server.
        Parameters:
        absJARURI - absolute URI of the unsigned file.
        Returns:
        URI to the file to be served
        Throws:
        IOException
      • addJAR

        public URI addJAR​(URI uriWithinAnchor,
                          URI absJARURI)
                   throws IOException
        Adds a JAR to the manager, returning the URI to the file to be served. This might be an auto-signed file if the original JAR is unsigned.
        Parameters:
        uriWithinAnchor - relative URI to the JAR within the anchor directory for the app
        jarURI - URI to the JAR file in the app to be served
        Returns:
        URI to the JAR file to serve (either the original file or an auto-signed copy of the original)
        Throws:
        IOException
      • staticContent

        public StaticContent staticContent​(URI jarURIRelativeToApp)