if (basename.equals("ROOT")) {
path = "";
} else {
- path = "/" + basename;
+ path = "/" + basename.replace('#', '/');
}
if ((host.findChild(path) != null) && !isDeployed(path)) {
// Ignore
}
try {
+ if (path.lastIndexOf('/') > 0) {
+ path = "/" + path.substring(1).replace('/','#');
+ }
File war = new File(getAppBase(), getDocBase(path) + ".war");
File dir = new File(getAppBase(), getDocBase(path));
File xml = new File(configBase, getConfigFile(path) + ".xml");
xml.delete();
}
// Perform new deployment
- check(path);
+ check(path.replace('#', '/'));
} finally {
- removeServiced(path);
+ removeServiced(path.replace('#','/'));
}
}
writer.println(sm.getString("managerServlet.undeployed",
/**
- * Given a context path, get the config file name.
+ * Given a context path, get the doc base.
*/
protected String getDocBase(String path) {
String basename = null;
if (path.equals("")) {
basename = "ROOT";
} else {
- basename = path.substring(1);
+ basename = path.substring(1).replace('/', '#');
}
return (basename);
}
String contextPath = context.getPath();
if (contextPath.equals("")) {
contextPath = "ROOT";
+ } else {
+ if (contextPath.lastIndexOf('/') > 0) {
+ contextPath = "/" + contextPath.substring(1).replace('/','#');
+ }
}
if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) {
- URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/");
+ URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
File warFile = new File(docBase + ".war");
if (warFile.exists()) {
if (unpackWARs) {
- URL war = new URL("jar:" + warFile.toURL() + "!/");
+ URL war =
+ new URL("jar:" + warFile.toURI().toURL() + "!/");
docBase = ExpandWar.expand(host, war, contextPath);
file = new File(docBase);
docBase = file.getCanonicalPath();
/**
- * Given a context path, get the config file name.
+ * Given a context path, get the docBase.
*/
protected String getDocBase(String path) {
String basename = null;
if (path.equals("")) {
basename = "ROOT";
} else {
- basename = path.substring(1);
+ basename = path.substring(1).replace('/', '#');
}
return (basename);
}
File appBase = appBase();
File configBase = configBase();
String baseName = getConfigFile(name);
- String docBase = getConfigFile(name);
+ String docBase = getDocBase(name);
// Deploy XML descriptors from configBase
File xml = new File(configBase, baseName + ".xml");
if (files[i].toLowerCase().endsWith(".war") && dir.isFile()) {
// Calculate the context path and make sure it is unique
- String contextPath = "/" + files[i];
+ String contextPath = "/" + files[i].replace('#','/');
int period = contextPath.lastIndexOf(".");
if (period >= 0)
contextPath = contextPath.substring(0, period);
name = path;
}
}
+ name = name.replace('/', '#');
File docBase = new File(name);
if (!docBase.isAbsolute()) {
docBase = new File(appBase(), name);
if (dir.isDirectory()) {
// Calculate the context path and make sure it is unique
- String contextPath = "/" + files[i];
+ String contextPath = "/" + files[i].replace('#','/');
if (files[i].equals("ROOT"))
contextPath = "";