From 1cdcecfe3e7a1ffaddd38ed938ee187ee7ed5323 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 4 Oct 2010 14:18:14 +0000 Subject: [PATCH] Remove duplicate method. Rename remaining method. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1004246 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/startup/HostConfig.java | 29 ++++++------------------ 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index b30d71031..b0b0a8045 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -451,23 +451,9 @@ public class HostConfig } /** - * Given a context path, get the config file name. + * Given a context path, get the base name for WARs, directories etc. */ - protected String getConfigFile(String path) { - String basename = null; - if (path.equals("")) { - basename = "ROOT"; - } else { - basename = path.substring(1).replace('/', '#'); - } - return (basename); - } - - - /** - * Given a context path, get the docBase. - */ - protected String getDocBase(String path) { + protected String getBaseName(String path) { String basename = null; if (path.equals("")) { basename = "ROOT"; @@ -504,21 +490,20 @@ public class HostConfig File appBase = appBase(); File configBase = configBase(); - String baseName = getConfigFile(name); - String docBase = getDocBase(name); + String baseName = getBaseName(name); // Deploy XML descriptors from configBase File xml = new File(configBase, baseName + ".xml"); if (xml.exists()) deployDescriptor(name, xml, baseName + ".xml"); // Deploy WARs, and loop if additional descriptors are found - File war = new File(appBase, docBase + ".war"); + File war = new File(appBase, baseName + ".war"); if (war.exists()) - deployWAR(name, war, docBase + ".war"); + deployWAR(name, war, baseName + ".war"); // Deploy expanded folders - File dir = new File(appBase, docBase); + File dir = new File(appBase, baseName); if (dir.exists()) - deployDirectory(name, dir, docBase); + deployDirectory(name, dir, baseName); } -- 2.11.0