Package org.apache.catalina.util
Class ContextName
- java.lang.Object
- 
- org.apache.catalina.util.ContextName
 
- 
 public final class ContextName extends java.lang.ObjectUtility class to manage context names so there is one place where the conversions between baseName, path and version take place.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringROOT_NAME
 - 
Constructor SummaryConstructors Constructor Description ContextName(java.lang.String name, boolean stripFileExtension)Creates an instance from a context name, display name, base name, directory name, WAR name or context.xml name.ContextName(java.lang.String path, java.lang.String version)Construct an instance from a path and version.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContextNameextractFromPath(java.lang.String path)Extract the final component of the given path which is assumed to be a base name and generate aContextNamefrom that base name.java.lang.StringgetBaseName()java.lang.StringgetDisplayName()java.lang.StringgetName()java.lang.StringgetPath()java.lang.StringgetVersion()java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
ROOT_NAMEpublic static final java.lang.String ROOT_NAME - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ContextNamepublic ContextName(java.lang.String name, boolean stripFileExtension)Creates an instance from a context name, display name, base name, directory name, WAR name or context.xml name.- Parameters:
- name- The name to use as the basis for this object
- stripFileExtension- If a .war or .xml file extension is present at the end of the provided name should it be removed?
 
 - 
ContextNamepublic ContextName(java.lang.String path, java.lang.String version)Construct an instance from a path and version.- Parameters:
- path- Context path to use
- version- Context version to use
 
 
- 
 - 
Method Detail- 
getBaseNamepublic java.lang.String getBaseName() 
 - 
getPathpublic java.lang.String getPath() 
 - 
getVersionpublic java.lang.String getVersion() 
 - 
getNamepublic java.lang.String getName() 
 - 
getDisplayNamepublic java.lang.String getDisplayName() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
extractFromPathpublic static ContextName extractFromPath(java.lang.String path) Extract the final component of the given path which is assumed to be a base name and generate aContextNamefrom that base name.- Parameters:
- path- The path that ends in a base name
- Returns:
- the ContextNamegenerated from the given base name
 
 
- 
 
-