Search in sources :

Example 1 with AutoSignedContent

use of org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent in project Payara by payara.

the class JWSAdapterManager method appLevelSignedSystemContent.

public synchronized AutoSignedContent appLevelSignedSystemContent(final String relativePathToSystemJar, final String alias) throws FileNotFoundException {
    /*
         * The key to the map is also the subpath to the file within the
         * domain's repository which holds signed system JARs.
         */
    final String key = keyToAppLevelSignedSystemContentMap(relativePathToSystemJar, alias);
    AutoSignedContent result = appLevelSignedSystemContent.get(key);
    if (result == null) {
        final File unsignedFile = new File(umbrellaRoot, relativePathToSystemJar);
        final File signedFile = new File(systemLevelSignedJARsRoot, key);
        result = new AutoSignedContent(unsignedFile, signedFile, alias, jarSigner, relativePathToSystemJar, MANIFEST_APP_NAME_FOR_SYSTEM_FILES);
        appLevelSignedSystemContent.put(key, result);
    }
    return result;
}
Also used : JarFile(java.util.jar.JarFile) File(java.io.File) AutoSignedContent(org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)

Example 2 with AutoSignedContent

use of org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent in project Payara by payara.

the class JWSAdapterManager method systemJarSignedContent.

private AutoSignedContent systemJarSignedContent(final File unsignedFile, final String signingAlias) throws FileNotFoundException {
    final String relativeURI = relativeSystemPath(unsignedFile.toURI());
    final File signedFile = new File(signedSystemContentAliasDir(signingAlias), relativeURI);
    return new AutoSignedContent(unsignedFile, signedFile, signingAlias, jarSigner, relativeURI, MANIFEST_APP_NAME_FOR_SYSTEM_FILES);
}
Also used : JarFile(java.util.jar.JarFile) File(java.io.File) AutoSignedContent(org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)

Example 3 with AutoSignedContent

use of org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent in project Payara by payara.

the class ApplicationSignedJARManager method autoSignedAppContentEntry.

/*
     * Returns information about an auto-signed JAR for a given absolute URI and
     * alias, creating the auto-signed content object and adding it to the
     * data structures if it is not already present.
     */
private synchronized Map.Entry<URI, StaticContent> autoSignedAppContentEntry(final URI jarURIRelativeToApp, final URI absURIToFile) throws FileNotFoundException {
    StaticContent content = relURIToContent.get(jarURIRelativeToApp);
    if (content == null) {
        final File unsignedFile = new File(absURIToFile);
        final File signedFile = signedFileForLib(jarURIRelativeToApp, unsignedFile);
        content = new AutoSignedContent(unsignedFile, signedFile, autoSigningAlias, jarSigner, jarURIRelativeToApp.toASCIIString(), helper.appName());
        relURIToContent.put(jarURIRelativeToApp, content);
    } else {
        if (content instanceof AutoSignedContent) {
            content = AutoSignedContent.class.cast(content);
        } else {
            throw new RuntimeException(content.toString() + " != AutoSignedContent");
        }
    }
    return new AbstractMap.SimpleEntry(jarURIRelativeToApp, content);
}
Also used : StaticContent(org.glassfish.appclient.server.core.jws.servedcontent.StaticContent) JarFile(java.util.jar.JarFile) File(java.io.File) AutoSignedContent(org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)

Example 4 with AutoSignedContent

use of org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent in project Payara by payara.

the class JavaWebStartInfo method createSignedStaticContent.

private StaticContent createSignedStaticContent(final File unsignedFile, final File signedFile, final URI uriForLookup, final String appName) throws FileNotFoundException {
    mkdirs(signedFile.getParentFile());
    final StaticContent signedJarContent = new AutoSignedContent(unsignedFile, signedFile, signingAlias, jarSigner, uriForLookup.toASCIIString(), appName);
    return signedJarContent;
}
Also used : StreamedAutoSignedStaticContent(org.glassfish.appclient.server.core.jws.servedcontent.StreamedAutoSignedStaticContent) StaticContent(org.glassfish.appclient.server.core.jws.servedcontent.StaticContent) AutoSignedContent(org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)

Aggregations

AutoSignedContent (org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)4 File (java.io.File)3 JarFile (java.util.jar.JarFile)3 StaticContent (org.glassfish.appclient.server.core.jws.servedcontent.StaticContent)2 StreamedAutoSignedStaticContent (org.glassfish.appclient.server.core.jws.servedcontent.StreamedAutoSignedStaticContent)1