private static String finalName(final String path) { if (isRoot(path)) { return "/"; } return path; }
private String getId(final String host, final String context, final String version) { String contextRoot = context; if (isRoot(contextRoot)) { contextRoot = ""; } if (!contextRoot.startsWith("/")) { contextRoot = "/" + contextRoot; } return (host == null ? hosts.getDefaultHost() : host) + contextRoot + (version == null || version.isEmpty() ? "" : (version.startsWith("##") ? version : "##" + version)); }
/** * Returns true if given application is deployed * false otherwise. * * @param file web application file * @param standardHost host * @return true if given application is deployed */ private boolean isDeployed(final File file, final StandardHost standardHost) { if (deployedApps.containsKey(file.getAbsolutePath())) { return true; } // check if this is a deployed web application String name = "/" + file.getName(); // ROOT context is a special case if (isRoot(name)) { name = ""; } // can be a dir or a war so exists is fine return file.exists() && standardHost.findChild(name) != null; }
if (name.toLowerCase().endsWith(".war") || isRoot(name) || name.equalsIgnoreCase("META-INF") || name.equalsIgnoreCase("WEB-INF")) { continue;