KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > appclient > jws > AppserverStaticContent


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.appclient.jws;
25
26 import java.io.File JavaDoc;
27 import java.net.URI JavaDoc;
28
29 /**
30  *Represents content to be served back to Java Web Start on users' systems.
31  *
32  * @author tjquinn
33  */

34   
35 public class AppserverStaticContent extends StaticContent {
36
37     /** records whether this particular static content instance represents a signed jar or not */
38     private boolean isSigned = false;
39     
40     /**
41      *Returns a new instance of the AppserverStaticContent class.
42      *@param origin the owning ContentOrigin
43      *@param contentKey content key for storing and retrieving the content
44      *@param path path within the content's subcategory of this content
45      *@param file File object for the physical file corresponding to this static content
46      *@param installRootURI the app server's installation root URI
47      *@param isMainJarFile whether this appserver static content should be flagged as the main jar in a JNLP document
48      *@return new StaticContent object
49      */

50     public AppserverStaticContent(ContentOrigin origin, String JavaDoc contentKey, String JavaDoc path, File JavaDoc file, URI JavaDoc installRootURI, boolean isMainJarFile) {
51         super(origin, contentKey, path, file, installRootURI, isMainJarFile);
52     }
53
54     /**
55      *Returns a new instance of the AppserverStaticContent class that is not a main jar.
56      *@param origin the owning ContentOrigin for the new content
57      *@param contentKey content key for storing and retrieving the content
58      *@param path path within the content's subcategory of this content
59      *@param file File object for the physical file corresponding to this static content
60      *@param installRootURI installation URI for the app server
61      *@return new StaticContent object
62      */

63     public AppserverStaticContent(ContentOrigin origin, String JavaDoc contentKey, String JavaDoc path, File JavaDoc file, URI JavaDoc installRootURI) {
64         this(origin, contentKey, path, file, installRootURI, false);
65     }
66
67     /**
68      *Returns a new instance of the AppserverStaticContent class that is not a main jar.
69      *@param origin owning ContentOrigin of the new content
70      *@param content key prefix for storing and retrieving the content
71      *@param path within the content's subcategory of this content
72      *@param file object for the physical file corresponding to this static content
73      *@param the app server's installation root URI
74      *@param whether the content is a jar that contains the main class we want Java Web Start to run
75      *@param whether the content is a signed jar or not
76      *@return new StaticContent object
77      */

78     public AppserverStaticContent(ContentOrigin origin, String JavaDoc contentKey, String JavaDoc path, File JavaDoc file, URI JavaDoc installRootURI, boolean isMainJarFile, boolean isSigned) {
79         this(origin, contentKey, path, file, installRootURI, isMainJarFile);
80         this.isSigned = isSigned;
81     }
82     
83     /**
84      *Returns the path for this content.
85      *<p>
86      *For appserver static content, the content key and the path are the same.
87      */

88     public String JavaDoc getPath() {
89         return getContentKey();
90     }
91 }
92
Popular Tags