FileDocCategorySizeDatePackage
StaticContent.javaAPI DocGlassfish v2 API4558Fri May 04 22:34:12 BST 2007com.sun.enterprise.appclient.jws

StaticContent

public class StaticContent extends Content
Represents content that does not change from one request for it to the next.
author
tjquinn

Fields Summary
private URI
relativeURI
a URI relative to the install root URI of the app server installation
private boolean
isMainJarFile
indicates if this static content should be marked as the main jar file in a JNLP document
Constructors Summary
public StaticContent(ContentOrigin origin, String contentKey, String path, File file, URI installRootURI, boolean isMainJarFile)
Returns a new instance of StaticContent

param
origin the ContentOrigin that owns the new static content
param
contentKey content key for storing and retrieving the content
param
path path within the content's subcategory of this content
param
file File object for the physical file corresponding to this static content
param
installRootURI URI specifying the location of the static content file
return
new StaticContent object

        super(origin, contentKey, path);
        URI fileURI = file.toURI();
        relativeURI = installRootURI.relativize(fileURI);
        this.isMainJarFile = isMainJarFile;
    
Methods Summary
public java.lang.StringasJNLPJarElement()
Returns a string expression suitable for inclusion in a JNLP document listing this jar file.

return
string of the form

        String fullPath = "${request.scheme}://${request.host}:${request.port}" + 
                NamingConventions.fullJarPath(getContentKey());
        
        return "        <jar href=\"" + fullPath + "\" " + getMainExpr() + "/>" + lineSep;
    
public java.lang.StringgetMainExpr()
Returns a string expression suitable for use in a JNLP document's element for whether this represents the main jar file of the application.

        String result;
        if (isMainJarFile) {
            result = " main=\"true\"";
        } else {
            result = "";
        }
        return result;
    
public java.net.URIgetRelativeURI()
Retrieves the content's URI relative to the product's installation root.

        return relativeURI;
    
public java.lang.StringtoString()
Returns a string representation of the StaticContent instance.

        String result = super.toString() + ", relative URI=" + getRelativeURI() + ", isMain=" + isMainJarFile;
        return result;