Search in sources :

Example 11 with StaticContent

use of org.glassfish.appclient.server.core.jws.servedcontent.StaticContent 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)

Example 12 with StaticContent

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

the class RestrictedContentAdapter method addContentIfAbsent.

// public String userFriendlyContextRoot() {
// return userFriendlyContextRoot;
// }
public synchronized void addContentIfAbsent(final String relativeURIString, final StaticContent newContent) throws IOException {
    final StaticContent existingContent = content.get(relativeURIString);
    if (existingContent != null) {
        if (!existingContent.equals(newContent)) {
            logger.log(Level.FINE, "enterprise.deployment.appclient.jws.staticContentCollision", new Object[] { relativeURIString, newContent.toString() });
        }
        return;
    }
    this.content.put(relativeURIString, newContent);
    // this.cache.put(relativeURIString, newContent.file());
    if (logger.isLoggable(Level.FINE)) {
        logger.fine(logPrefix() + "adding static content " + relativeURIString + " " + newContent.toString());
    }
}
Also used : StaticContent(org.glassfish.appclient.server.core.jws.servedcontent.StaticContent)

Example 13 with StaticContent

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

the class NestedAppClientDeployerHelper method createAndAddLibraryJNLPs.

@Override
public void createAndAddLibraryJNLPs(final AppClientDeployerHelper helper, final TokenHelper tHelper, final Map<String, DynamicContent> dynamicContent) throws IOException {
    /*
         * For each group of like-signed library JARs create a separate JNLP for
         * the group and add it to the dynamic content for the client.  Also
         * build up a property to hold the full list of such generated JNLPs
         * so it can be substituted into the generated client JNLP below.
         */
    libExtensionElementsForMainDocument = new StringBuilder();
    for (Map.Entry<String, Map<URI, StaticContent>> aliasToContentEntry : signingAliasToJar().entrySet()) {
        final String alias = aliasToContentEntry.getKey();
        final Map<URI, StaticContent> libURIs = aliasToContentEntry.getValue();
        tHelper.setProperty(LIBRARY_SECURITY_PROPERTY_NAME, librarySecurity(alias));
        tHelper.setProperty(LIBRARY_JNLP_PATH_PROPERTY_NAME, libJNLPRelPath(alias));
        final StringBuilder libJarElements = new StringBuilder();
        for (Map.Entry<URI, StaticContent> entry : libURIs.entrySet()) {
            final URI uri = entry.getKey();
            libJarElements.append("<jar href=\"").append(libJARRelPath(uri)).append("\"/>");
        }
        tHelper.setProperty(LIBRARY_JARS_PROPERTY_NAME, libJarElements.toString());
        JavaWebStartInfo.createAndAddDynamicContent(tHelper, dynamicContent, libJNLPRelPath(alias), LIBRARY_DOCUMENT_TEMPLATE);
        libExtensionElementsForMainDocument.append(extensionElement(alias, libJNLPRelPath(alias)));
    }
    tHelper.setProperty(JavaWebStartInfo.APP_LIBRARY_EXTENSION_PROPERTY_NAME, libExtensionElementsForMainDocument.toString());
}
Also used : StaticContent(org.glassfish.appclient.server.core.jws.servedcontent.StaticContent) Map(java.util.Map) URI(java.net.URI)

Aggregations

StaticContent (org.glassfish.appclient.server.core.jws.servedcontent.StaticContent)13 URI (java.net.URI)7 File (java.io.File)6 JarFile (java.util.jar.JarFile)5 StreamedAutoSignedStaticContent (org.glassfish.appclient.server.core.jws.servedcontent.StreamedAutoSignedStaticContent)4 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AutoSignedContent (org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent)2 FileFilter (java.io.FileFilter)1 IOException (java.io.IOException)1 AbstractMap (java.util.AbstractMap)1 ArrayList (java.util.ArrayList)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Manifest (java.util.jar.Manifest)1 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)1 Extension (org.glassfish.appclient.server.core.jws.ExtensionFileManager.Extension)1 FixedContent (org.glassfish.appclient.server.core.jws.servedcontent.FixedContent)1