* application
*/
public static String[] getContextRootsForEmbeddedWebApp(String appName)
throws IASDeploymentException {
try {
AppsManager appsManager =
new AppsManager(new InstanceEnvironment(getInstanceName()));
Application application =
appsManager.getRegisteredDescriptor(appName);
// if the application already loaded on DAS
if (application != null) {
ArrayList contextRoots = new ArrayList();
for (Iterator itr = application.getWebBundleDescriptors().iterator(); itr.hasNext();) {
WebBundleDescriptor wbd = (WebBundleDescriptor) itr.next();
contextRoots.add(wbd.getContextRoot());
}
return (String[])contextRoots.toArray(new String[contextRoots.size()]);
// if not, read from disk
} else {
// load from generated/xml dir first
// print a warning if generated/xml dir is not there
// and load from original dir (upgrade scenario)
String xmlDir = appsManager.getGeneratedXMLLocation(appName);
if (!FileUtils.safeIsDirectory(xmlDir)) {
String appDir = appsManager.getLocation(appName);
// log a warning message in the server log
sLogger.log(Level.WARNING, "deployment.no_xmldir",
new Object[]{xmlDir, appDir});
xmlDir = appDir;
}