KickJava   Java API By Example, From Geeks To Geeks.

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


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 package com.sun.enterprise.appclient.jws;
24 import com.sun.enterprise.config.ConfigException;
25 import com.sun.enterprise.deployment.Application;
26 import com.sun.enterprise.deployment.ApplicationClientDescriptor;
27 import com.sun.enterprise.deployment.BundleDescriptor;
28 import com.sun.enterprise.deployment.interfaces.DeploymentImplConstants;
29 import com.sun.enterprise.deployment.runtime.JavaWebStartAccessDescriptor;
30 import com.sun.enterprise.deployment.util.ModuleDescriptor;
31 import com.sun.enterprise.instance.AppclientModulesManager;
32 import com.sun.enterprise.instance.ApplicationEnvironment;
33 import com.sun.enterprise.instance.AppsManager;
34 import com.sun.enterprise.instance.BaseManager;
35 import com.sun.enterprise.instance.InstanceEnvironment;
36 import com.sun.enterprise.server.ApplicationServer;
37 import com.sun.enterprise.server.ServerContext;
38 import com.sun.enterprise.util.i18n.StringManager;
39 import com.sun.enterprise.web.WebContainer;
40 import com.sun.logging.LogDomains;
41 import java.io.File JavaDoc;
42 import java.io.FileFilter JavaDoc;
43 import java.io.FilenameFilter JavaDoc;
44 import java.net.URI JavaDoc;
45 import java.net.URISyntaxException JavaDoc;
46 import java.util.Iterator JavaDoc;
47 import java.util.Vector JavaDoc;
48 import java.util.logging.Level JavaDoc;
49 import java.util.logging.Logger JavaDoc;
50 import javax.enterprise.deploy.shared.ModuleType JavaDoc;
51 import javax.servlet.ServletConfig JavaDoc;
52 import javax.servlet.http.HttpServletRequest JavaDoc;
53
54 /**
55  *Defines strings and algorithms used in constructing names, URLs, etc. related to supporting Java
56  *Web Start access to app clients.
57  *<p>
58  *The logic for building names, URLs, etc. is collected into this one class
59  *so it is easier to understand go to make changes.
60  *
61  * @author tjquinn
62  */

63 public class NamingConventions {
64     
65     /** fixed prefix for URLs handled by the Java Web Start support web app */
66     
67     /*
68      *The system EAR for Java Web Start specifies the URL for the embedded
69      *web app. That same value must be assigned here.
70      */

71     public static final String JavaDoc SYSTEM_WEBAPP_URL = "/__JWSappclients";
72     
73     /**
74      *Performs any conversion needed from the HTTP request path information to
75      *the corresponding content key
76      *@param the pathInfo from the HTTP request
77      *@return the content key for the given request pathInfo
78      */

79     public static String JavaDoc pathToContentKey(String JavaDoc requestPath) {
80         return requestPath;
81     }
82     
83     /**
84      *Converts the content key into the corresponding path for URLs.
85      *@param content key to be converted
86      *@return the path to be used in URLs
87      */

88     public static String JavaDoc contentKeyToPath(String JavaDoc contentKey) {
89         return contentKey;
90     }
91     
92     /**
93      *URL paths used to request content have this form:
94      *
95      *${category}/${subcategory}/${path-to-content}
96      *
97      *The subcategory has different meanings depending on the category.
98      *
99      *Categories:
100      *
101      *appclient - Content related to a particular app client. The subcategory
102      *is the appclient's context-root (for Java Web Start access) assigned either
103      *by the user in the runtime deployment descriptor or by default - the module ID
104      *
105      *application - Content related to the enterprise app in which one or more
106      *app clients were bundled. The subcategory is the enterprise app's module
107      *ID.
108      *
109      *appserver - Content related to the app server itself. The subcategory
110      *is used to gather files and content into roughly related groups. Partly it
111      *exists to let the Java Web Start support logic treat all requests pretty
112      *uniformly.
113      *
114      *appserverS - Content related to the app server itself, but signed (jars).
115      *
116      */

117     
118     /** Category definitions */
119     public static final String JavaDoc APPCLIENT_CATEGORY = "__appclient";
120     public static final String JavaDoc APPLICATION_CATEGORY = "__application";
121     public static final String JavaDoc APPSERVER_CATEGORY = "__appserver";
122     public static final String JavaDoc APPSERVER_SIGNED_CATEGORY = "__appserverS";
123     
124     /** Subcategories of appserver content. */
125
126     public static final String JavaDoc APPSERVER_LIB_FILES = "aslib"; // typically in ${installRoot}/lib
127
public static final String JavaDoc APPSERVER_MQLIB_FILES = "mqlib"; // MQ files packaged with the app server - typically in ${installRoot}/imq/lib
128
public static final String JavaDoc APPSERVER_JMSRALIB_FILES = "jmsralib"; // JMS files packaged with the app server - in ${installRoot}/lib/install/applications/jmsra
129
public static final String JavaDoc APPSERVER_EXTJAR_FILES = "extjar"; // extension jars
130
public static final String JavaDoc APPSERVER_DERBY_FILES = "derby"; // derby library jar files
131
/**
132      *Templates for dynamic documents are packaged in the jar file with this class.
133      *These names are used in getResource method invocations to retrieve the templates.
134      */

135     public static final String JavaDoc APPCLIENT_MAIN_JNLP_TEMPLATE_NAME = "appclientMainDocumentTemplate.jnlp";
136     public static final String JavaDoc APPCLIENT_CLIENT_JNLP_TEMPLATE_NAME = "appclientClientDocumentTemplate.jnlp";
137     public static final String JavaDoc APPCLIENT_MAIN_HTML_TEMPLATE_NAME = "appclientMainDocumentTemplate.html";
138     public static final String JavaDoc APPCLIENT_CLIENT_HTML_TEMPLATE_NAME = "appclientClientDocumentTemplate.html";
139     public static final String JavaDoc APPCLIENT_MAIN_JNLP_EXT_TEMPLATE_NAME = "appclientMainExtDocumentTemplate.jnlp";
140
141     /**
142      *Several generated virtual file names use the context root as part of the
143      *name with fixed suffix appended.
144      */

145     private static final String JavaDoc MAIN_JNLP_SUFFIX = ".jnlp";
146     private static final String JavaDoc MAIN_HTML_SUFFIX = "-jnlp.html";
147     private static final String JavaDoc CLIENT_JNLP_SUFFIX = "-client.jnlp";
148     private static final String JavaDoc CLIENT_HTML_SUFFIX = "-client-jnlp.html";
149     private static final String JavaDoc MAIN_EXT_JNLP_SUFFIX = "-ext.jnlp";
150     
151     /** the logger to use for Java Web Start-related code */
152     public static final String JavaDoc JWS_LOGGER = LogDomains.DPL_LOGGER;
153     
154     /**
155      *The admin GUI (or any other client) can create an instance of NamingConventions
156      *for use in retrieving the actual URL path for a stand-alone app client
157      *or a nested app client, including using user-specified paths if they
158      *are present.
159      *
160      *The next instance variables support that use.
161      */

162     
163     /** the instance's apps manager */
164     private AppsManager appsManager = null;
165     
166     /** the instance's app client modules manager */
167     private AppclientModulesManager appclientModulesManager = null;
168     
169     /**
170      *Creates a new instance of NamingConventions, locating the required
171      *manager objects automatically.
172      *@throws ConfigException in case of any problem locating the app server
173      *objects that provide the AppsManager and AppclientModulesManager objects.
174      */

175     public NamingConventions() throws ConfigException {
176         ServerContext appServerContext;
177         InstanceEnvironment instEnv;
178         
179         if ((appServerContext = ApplicationServer.getServerContext()) == null) {
180             throw new ConfigException("Error getting current app server context; ApplicationServer.getServerContext() returned null");
181         }
182         if ((instEnv = appServerContext.getInstanceEnvironment()) == null) {
183             throw new ConfigException("Error getting current instance environment; appServercontext.getInstanceEnvironment() returned null");
184         }
185         appsManager = new AppsManager(instEnv, false);
186         appclientModulesManager = new AppclientModulesManager(instEnv, false);
187     }
188     
189     /** Creates a new instance of NamingConventions, using previously-created
190      *references to the two manager objects.
191      *@param appsManager the AppsManager instance to use for looking up applications
192      *@param appclientsManager the AppclientModulesManager instance to use for looking up app clients
193      */

194     public NamingConventions(AppsManager appsManager, AppclientModulesManager appclientModulesManager) {
195         this.appsManager = appsManager;
196         this.appclientModulesManager = appclientModulesManager;
197     }
198     
199     public static String JavaDoc webAppURI() {
200         return SYSTEM_WEBAPP_URL;
201     }
202     
203     public static String JavaDoc appServerCodebasePath() {
204         return SYSTEM_WEBAPP_URL + "/" + APPSERVER_CATEGORY;
205     }
206
207     public static String JavaDoc fullJarPath(String JavaDoc contentKey) {
208         return SYSTEM_WEBAPP_URL + contentKeyToPath(contentKey);
209     }
210     
211     public static String JavaDoc relativeFilePath(URI JavaDoc instanceRootDirURI, File JavaDoc targetFile) {
212         URI JavaDoc targetURI = targetFile.toURI();
213         URI JavaDoc relativeURI = instanceRootDirURI.relativize(targetURI);
214         return relativeURI.toString();
215     }
216
217     public static String JavaDoc extJarFilePath(int extDirNumber, File JavaDoc extJarFile) {
218         String JavaDoc path = "/" + extDirNumber + "/" + extJarFile.getName();
219         return path;
220     }
221
222     /**
223      *Returns the developer-specified context root from the app client's
224      *runtime descriptor.
225      *@return the developer-specified context root; null if none was specified
226      */

227     private static String JavaDoc getExplicitContextRoot(ModuleDescriptor moduleDescr) {
228         /*
229          *Return the developer-specified context root, if there is one.
230          */

231         String JavaDoc result = null;
232
233         BundleDescriptor bd = moduleDescr.getDescriptor();
234         if (bd instanceof ApplicationClientDescriptor) {
235             ApplicationClientDescriptor acd = (ApplicationClientDescriptor) bd;
236             JavaWebStartAccessDescriptor jwsAD = acd.getJavaWebStartAccessDescriptor();
237             if (jwsAD != null) {
238                 result = jwsAD.getContextRoot();
239             }
240         }
241         return result;
242     }
243     
244     /**
245      *Returns the explicit context root, if non-null, or the default value otherwise.
246      *@return the correct context root value to be used
247      */

248     private static String JavaDoc chooseContextRoot(String JavaDoc explicitValue, String JavaDoc defaultValue) {
249         return (explicitValue == null) ? defaultValue : explicitValue;
250     }
251     
252     public static String JavaDoc appclientCodebasePath(AppclientContentOrigin origin) {
253         String JavaDoc result = SYSTEM_WEBAPP_URL + "/" + APPCLIENT_CATEGORY + /* "/" + */ origin.getContextRoot();
254         return result;
255     }
256
257     private static String JavaDoc appclientJarFilename(String JavaDoc regName) {
258         return regName + DeploymentImplConstants.ClientJarSuffix;
259     }
260
261   
262     /**
263      *Defines naming conventions specific to top-level app clients.
264      */

265     public static class TopLevelAppclient {
266         
267         public static String JavaDoc virtualContextRoot(Application application, ModuleDescriptor moduleDescr) {
268             return chooseContextRoot(getExplicitContextRoot(moduleDescr), defaultVirtualContextRoot(application));
269             }
270         
271         public static String JavaDoc actualContextRoot(Application application) {
272             String JavaDoc regName = application.getRegistrationName();
273             return "/" + APPCLIENT_CATEGORY + "/" + regName + NamingConventions.Main.JNLPPath(regName);
274         }
275         
276         public static String JavaDoc defaultVirtualContextRoot(Application application) {
277             return "/" + application.getRegistrationName();
278         }
279         
280         public static String JavaDoc contentKeyPrefix(AppclientContentOrigin origin) {
281             return "/" + APPCLIENT_CATEGORY + "/" + origin.getTopLevelRegistrationName();
282         }
283         
284         public static String JavaDoc appclientJarPath(AppclientContentOrigin origin) {
285             return "/" + appclientJarFilename(origin.getTopLevelRegistrationName());
286         }
287     }
288
289     /**
290      *Defines naming conventions specific to nested app clients.
291      */

292     public static class NestedAppclient {
293         
294         public static String JavaDoc virtualContextRoot(Application parentApplication, ModuleDescriptor moduleDescr) {
295             return chooseContextRoot(getExplicitContextRoot(moduleDescr), defaultVirtualContextRoot(parentApplication, moduleDescr));
296         }
297         
298         public static String JavaDoc actualContextRoot(NestedAppclientContentOrigin origin) {
299             String JavaDoc regName = origin.getTopLevelRegistrationName();
300             String JavaDoc clientName = origin.getName();
301             return "/" + APPCLIENT_CATEGORY + "/" + regName + "/" + clientName + NamingConventions.Main.JNLPPath(clientName);
302         }
303         
304         public static String JavaDoc defaultVirtualContextRoot(Application parentApplication, ModuleDescriptor moduleDescr) {
305             return "/" + parentApplication.getRegistrationName() + "/" + trimJarFileType(moduleDescr.getArchiveUri(),"");
306         }
307  
308         public static String JavaDoc contentKeyPrefix(NestedAppclientContentOrigin origin) {
309             return "/" + APPCLIENT_CATEGORY + "/" + origin.getTopLevelRegistrationName() + "/" + origin.getName();
310         }
311         
312         /*
313          *Nested app clients do not have their own appclient jar files, so there
314          *is no implementation of that method for this inner class.
315          */

316         
317         /**
318          *Returns the string to use as the app client identifier within the
319          *parent application.
320          *<p>
321          *Nested app clients are uniquely identified within the containing parent
322          *only by the URI to the archive. Convert the URI to the archive into
323          *a unique name by removing the trailing ".jar" from the URI.
324          *@param URI to the archive in string form
325          *@return the unique name for this nested app client within its parent
326          */

327         public static String JavaDoc archiveURIToName(String JavaDoc archiveURI) {
328             return trimJarFileType(archiveURI, "");
329         }
330     }
331     
332     public static class TopLevelApplication {
333         
334         public static String JavaDoc contextRoot(Application application) {
335             return "/" + application.getRegistrationName();
336         }
337         
338         public static String JavaDoc contentKeyPrefix(ApplicationContentOrigin origin) {
339             return "/" + APPLICATION_CATEGORY + "/" + origin.getTopLevelRegistrationName();
340         }
341         
342         public static String JavaDoc appclientJarPath(ApplicationContentOrigin origin) {
343             return "/" + appclientJarFilename(origin.getTopLevelRegistrationName());
344         }
345     }
346     
347     public static class Appserver {
348         public static String JavaDoc contentKeyPrefix(AppserverContentOrigin origin) {
349             return "/" + APPSERVER_CATEGORY + "/" + origin.getSubcategory();
350         }
351     }
352     
353     /**
354      *Defines naming conventions related to the main JNLP document created for
355      *either top-level or nested app clients.
356      */

357     public static class Main {
358
359         private static final String JavaDoc name = "main";
360         
361         public static String JavaDoc JNLPFilename(String JavaDoc regName) {
362             return name + MAIN_JNLP_SUFFIX;
363         }
364         
365         public static String JavaDoc JNLPPath(String JavaDoc regName) {
366             return "/" + JNLPFilename(regName);
367         }
368
369         public static String JavaDoc JNLPExtFilename(String JavaDoc regName) {
370             return name + MAIN_EXT_JNLP_SUFFIX;
371         }
372
373         public static String JavaDoc JNLPExtPath(String JavaDoc regName) {
374             return "/" + JNLPExtFilename(regName);
375         }
376
377         public static String JavaDoc HTMLPath(String JavaDoc regName) {
378             return "/" + HTMLFilename(regName);
379         }
380
381         public static String JavaDoc HTMLFilename(String JavaDoc regName) {
382             return name + MAIN_HTML_SUFFIX;
383         }
384     }
385
386     /**
387      *Defines naming conventions related to the client JNLP document created for
388      *either top-level or nested app clients.
389      */

390     public static class Client {
391
392         private static final String JavaDoc name = "client";
393         
394         public static String JavaDoc JNLPFilename(String JavaDoc regName) {
395             return name + CLIENT_JNLP_SUFFIX;
396         }
397
398         public static String JavaDoc JNLPPath(String JavaDoc regName) {
399             return "/" + JNLPFilename(regName);
400         }
401
402         public static String JavaDoc HTMLFilename(String JavaDoc regName) {
403             return name + CLIENT_HTML_SUFFIX;
404         }
405
406         public static String JavaDoc HTMLPath(String JavaDoc regName) {
407             return "/" + HTMLFilename(regName);
408         }
409     }
410
411
412     /**
413      *Replaces the final appearance of ".jar" in the input string with the
414      *replacement string.
415      *@param the input string (typically the URI of the app client jar file)
416      *@param the string to replace the final ".jar" in the original
417      */

418     private static String JavaDoc trimJarFileType(String JavaDoc jarURI, String JavaDoc replacement) {
419         int startOfType = jarURI.lastIndexOf(".jar");
420         if (startOfType == -1) {
421             startOfType = jarURI.length();
422         }
423         String JavaDoc result = jarURI.substring(0, startOfType) + replacement;
424         return result;
425     }
426     
427     /**
428      *Returns the URL path for use in launching the stand-alone app client with the
429      *specified module ID.
430      *@param moduleID the module ID of the stand-alone app client
431      *@return String containing the URL path (excluding scheme, host, and port) for launching the app client; null if the
432      *app client is not eligible for Java Web Start access or cannot be queried
433      */

434     public String JavaDoc getLaunchURLPath(String JavaDoc appclientModuleID) {
435         String JavaDoc result = null;
436         try {
437             Application app = appclientModulesManager.getDescriptor(appclientModuleID, Thread.currentThread().getContextClassLoader(), false);
438             /*
439              *There should be exactly one app client ModuleDescriptor in this wrapper app.
440              */

441             ModuleDescriptor[] moduleDescrs = getEligibleAppclientModuleDescriptors(app);
442             if (moduleDescrs.length == 1) {
443                 /*
444                  *With the app client's module descr, find the path using either
445                  *the developer-provided path or the default one.
446                  */

447                 result = TopLevelAppclient.virtualContextRoot(app, moduleDescrs[0]);
448             }
449         } catch (ConfigException ce) {
450             /*
451              *Allow the return to be null if we cannot locate the app client.
452              */

453         }
454         return result;
455     }
456     
457     /**
458      *Returns the URL path for use in launching the app client with the specified
459      *archive URI embedded in the application with the specified module ID.
460      *@param appModuleID the module ID of the application containing the app client
461      *@param appclientArchiveURI the URI of the app client within the ear
462      *@return String containing the URL path (excluding scheme, host, and port) for launching the app client; null if the
463      *app client is not eligible for Java Web Start access, or it or the containing
464      *app cannot be found
465      */

466     public String JavaDoc getLaunchURLPath(String JavaDoc appModuleID, String JavaDoc appclientArchiveURI) {
467         String JavaDoc result = null;
468         try {
469             Application app = appsManager.getDescriptor(appModuleID, Thread.currentThread().getContextClassLoader(), false);
470             ModuleDescriptor[] moduleDescrs = getEligibleAppclientModuleDescriptors(app);
471             /*
472              *Search the eligible module descriptors for one with an archive
473              *URI that matches the desired one.
474              */

475             for (ModuleDescriptor m : moduleDescrs) {
476                 String JavaDoc archiveURI = m.getArchiveUri();
477                 if (archiveURI != null && archiveURI.equals(appclientArchiveURI)) {
478                     result = NestedAppclient.virtualContextRoot(app, m);
479                     break;
480                 }
481             }
482         } catch (ConfigException ce) {
483             /*
484              *Allow the return to be null if we cannot locate the app.
485              */

486         }
487         return result;
488     }
489
490     /**
491      *Returns an array of ModuleDescriptors corresponding to the app clients
492      *in this application that are eligible for Java Web Start access.
493      *@param app Application containing (potentially) the nested app clients
494      *@return array of ModuleDescriptor objects for eligible app clients
495      */

496     public static ModuleDescriptor[] getEligibleAppclientModuleDescriptors(Application app) {
497         return getEligibleAppclientModuleDescriptors(app, null);
498     }
499     
500     
501     /**
502      *Returns an array of ModuleDescriptors corresponding to the app clients
503      *in this application that are eligible for Java Web Start access. Provides
504      *logging if the expected nested ModuleDescriptor(s) are not found.
505      *@param Application containing (potentially) the nested app clients
506      *@param logger the Logger to use for writing warnings
507      *@return array of ModuleDescriptor objects for eligible app clients
508      */

509     public static ModuleDescriptor[] getEligibleAppclientModuleDescriptors(Application app, Logger JavaDoc logger) {
510         Vector JavaDoc<ModuleDescriptor> mds = new Vector JavaDoc<ModuleDescriptor>();
511
512         /*
513          *Iterate through the app's app client modules. For each, get the bundle
514          *descriptor and make sure it's an app client descriptor. If so, get
515          *that descriptor's Java Web Start access descriptor. If that is null, or
516          *if it's non-null and the JWS access descriptor says the app client is
517          *eligible for JWS access, add the module descriptor to the collection
518          *to be returned.
519          */

520         for (Iterator JavaDoc it = app.getModulesByType(ModuleType.CAR); it.hasNext();) {
521             Object JavaDoc o = it.next();
522             if (o instanceof ModuleDescriptor) {
523                 ModuleDescriptor moduleDescriptor = (ModuleDescriptor) o;
524                 BundleDescriptor bd = moduleDescriptor.getDescriptor();
525                 if (bd instanceof ApplicationClientDescriptor) {
526                     ApplicationClientDescriptor appclientDescriptor = (ApplicationClientDescriptor) bd;
527                     JavaWebStartAccessDescriptor jwsAD = appclientDescriptor.getJavaWebStartAccessDescriptor();
528                     if (jwsAD == null || jwsAD.isEligible()) {
529                         mds.add(moduleDescriptor);
530                     }
531                 } else {
532                     if (logger != null) {
533                         logger.warning("During app/app client loading, expected bundleDescriptor for app client module to be of type ApplicationClientDescriptor but it is " + bd.getClass().getName() + "; ignoring it and continuing");
534                     }
535                 }
536             } else {
537                 if (logger != null) {
538                     logger.warning("During app/app client loading, expected descriptor of type ModuleDescriptor but found " + o.getClass().getName() + " instead; ignoring it and continuing");
539                 }
540             }
541         }
542         return mds.toArray(new ModuleDescriptor[mds.size()]);
543     }
544     
545     /**
546      *Encapsulates logic related to detecing and handling signed copies of the
547      *generated app client jar.
548      */

549     public static class SignedJar {
550
551         private static String JavaDoc SIGNED_JAR_FILENAME_SUFFIX = "-signed";
552
553         /**
554          *Returns a File for the signed version of the generated app client jar.
555          *@param origin the UserContentOrigin (the app or app client) that owns the jar
556          *@param instEnv the environment for this instance
557          *@param generatedAppclientFile the generated app client jar file
558          *@return File for where the signed generated app client jar should be
559          */

560         public static File JavaDoc signedGeneratedAppclientJarFile(
561                 UserContentOrigin origin,
562                 InstanceEnvironment instEnv,
563                 File JavaDoc generatedAppclientFile) {
564             String JavaDoc regName = origin.getTopLevelRegistrationName();
565             ApplicationEnvironment appEnv = instEnv.getApplicationEnvironment(regName);
566             File JavaDoc result = new File JavaDoc(appEnv.getJavaWebStartPath(), signedJarPath(generatedAppclientFile.getName()));
567             return result;
568         }
569
570         /**
571          *Returns the path for the signed jar based on the path for the unsigned jar.
572          *@param unsignedJarPath path (partial) for the unsigned jar
573          *@return the path for the corresponding signed jar
574          */

575         public static String JavaDoc signedJarPath(String JavaDoc unsignedJarPath) {
576 // int lastDot = unsignedJarPath.lastIndexOf('.');
577
// if (lastDot == -1) {
578
// throw new IllegalArgumentException(unsignedJarPath);
579
// }
580
// String signedJarPath = unsignedJarPath.substring(0, lastDot) + SIGNED_JAR_FILENAME_SUFFIX + unsignedJarPath.substring(lastDot);
581
// return signedJarPath;
582
return unsignedJarPath;
583         }
584
585         /**
586          *Return the java-web-start directory for the given application.
587          *@param instEnv InstanceEnvironment for the current instance
588          *@param regName the module name of the app for which the j-w-s directory is needed
589          *@return the directory file for the app's java-web-start subdirectory
590          */

591         private static File JavaDoc getAppJWSDir(InstanceEnvironment instEnv, String JavaDoc regName) {
592             ApplicationEnvironment appEnv = instEnv.getApplicationEnvironment(regName);
593             String JavaDoc appJWSDirPath = appEnv.getJavaWebStartPath();
594             File JavaDoc appJWSDir = new File JavaDoc(appJWSDirPath);
595             return appJWSDir;
596         }
597     }
598 }
599
Popular Tags