Class StreamedAutoSignedStaticContent
- java.lang.Object
-
- org.glassfish.appclient.server.core.jws.servedcontent.Content.Adapter
-
- org.glassfish.appclient.server.core.jws.servedcontent.FixedContent
-
- org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent
-
- org.glassfish.appclient.server.core.jws.servedcontent.StreamedAutoSignedStaticContent
-
- All Implemented Interfaces:
Content
,StaticContent
public class StreamedAutoSignedStaticContent extends AutoSignedContent
Auto-signed content that is delivered not as an on-disk file but as an output stream.This implementation supports the requirement to "sign" a JNLP document by including it in a signed JAR so the Java Web Start client can verify that the JNLP delivered is the correct document (as compared to the copy in the signed JAR delivered to the client).
Most signed JARs served by the Java Web Start support in GlassFish are created on-disk by signing their unsigned counterparts once. Then the on-disk signed JAR is served when the client asks for the JAR. The main JAR has to be handled differently to meet the Java Web start security requirements. The signed copy of the main JAR is created on-the-fly by signing the unsigned JAR's contents plus the previously-generated JNLP. The signed output is sent directly to the HTTP response's output stream rather than creating a temporary file.
We cannot create the signed main JAR once and for all because the JNLP document which launches the app might change from one invocation to the next, particularly regarding command-line arguments which appear in the JNLP as
elements. - Author:
- tjquinn
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.appclient.server.core.jws.servedcontent.Content
Content.Adapter, Content.State
-
-
Constructor Summary
Constructors Constructor Description StreamedAutoSignedStaticContent(File unsignedFile, String userProvidedAlias, ASJarSigner jarSigner, String relativeURI, String appName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAvailable(URI requestURI)
Reports whether the signed content is available.void
process(String relativeURIString, org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp)
Process the static content, adding the correct data to the response.-
Methods inherited from class org.glassfish.appclient.server.core.jws.servedcontent.AutoSignedContent
equals, file, hashCode, toString
-
Methods inherited from class org.glassfish.appclient.server.core.jws.servedcontent.Content.Adapter
resume, start, state, stop, suspend
-
-
-
-
Constructor Detail
-
StreamedAutoSignedStaticContent
public StreamedAutoSignedStaticContent(File unsignedFile, String userProvidedAlias, ASJarSigner jarSigner, String relativeURI, String appName) throws FileNotFoundException
- Throws:
FileNotFoundException
-
-
Method Detail
-
process
public void process(String relativeURIString, org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp) throws IOException
Description copied from interface:StaticContent
Process the static content, adding the correct data to the response.- Specified by:
process
in interfaceStaticContent
- Overrides:
process
in classFixedContent
- Parameters:
relativeURIString
- URI path by which the content was addressedgReq
- the requestgResp
- the response- Throws:
IOException
-
isAvailable
public boolean isAvailable(URI requestURI) throws IOException
Description copied from class:AutoSignedContent
Reports whether the signed content is available. As a side-effect, this method will create the signed file if it does not exist or is obsolete.- Specified by:
isAvailable
in interfaceContent
- Overrides:
isAvailable
in classAutoSignedContent
- Throws:
IOException
-
-