public static String getLocation(String moduleID) { ApplicationName module = getModule(moduleID); if (module == null) { return null; } String location = null; if (module instanceof Application) { location = ((Application)module).getLocation(); } else if (module instanceof WebModule) { location = ((WebModule)module).getLocation(); } else if (module instanceof EjbModule) { location = ((EjbModule)module).getLocation(); } else if (module instanceof ConnectorModule) { location = ((ConnectorModule)module).getLocation(); } else if (module instanceof AppclientModule) { location = ((AppclientModule)module).getLocation(); } else if (module instanceof J2eeApplication) { location = ((J2eeApplication)module).getLocation(); } try { if (location != null) { return new URI(location).getPath(); } else { return null; } } catch (URISyntaxException e) { return null; } }
app.setName(webModule.getName()); app.setLocation(getLocationAsURIString( webModule.getLocation())); app.setObjectType(webModule.getObjectType()); app.setDescription(webModule.getDescription());