Top Description Fields Constructors Methods
org.apache.catalina.util

public final Class ContextName

extends Object
Class Inheritance
Imports
java.util.Locale

Utility class to manage context names so there is one place where the conversions between baseName, path and version take place.

Field Summary

Modifier and TypeField and Description
private final String
private static final char
private final String
private final String
public static final String
private final String
private static final String

Constructor Summary

AccessConstructor and Description
public
ContextName(String
The name to use as the basis for this object
name
,
boolean
If a .war or .xml file extension is present at the end of the provided name should it be removed?
stripFileExtension
)

Creates an instance from a context name, display name, base name, directory name, WAR name or context.xml name.

public
ContextName(String
Context path to use
path
,
String
Context version to use
version
)

Construct an instance from a path and version.

Method Summary

Modifier and TypeMethod and Description
public static ContextName

Returns:

the ContextName generated from the given base name
extractFromPath
(String
The path that ends in a base name
path
)

Extract the final component of the given path which is assumed to be a base name and generate a ContextName from that base name.

public String
public String
public String
public String
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

baseNameback to summary
private final String baseName
FWD_SLASH_REPLACEMENTback to summary
private static final char FWD_SLASH_REPLACEMENT
nameback to summary
private final String name
pathback to summary
private final String path
ROOT_NAMEback to summary
public static final String ROOT_NAME
versionback to summary
private final String version
VERSION_MARKERback to summary
private static final String VERSION_MARKER

Constructor Detail

ContextNameback to summary
public ContextName(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:String

The name to use as the basis for this object

stripFileExtension:boolean

If a .war or .xml file extension is present at the end of the provided name should it be removed?

ContextNameback to summary
public ContextName(String path, String version)

Construct an instance from a path and version.

Parameters
path:String

Context path to use

version:String

Context version to use

Method Detail

extractFromPathback to summary
public static ContextName extractFromPath(String path)

Extract the final component of the given path which is assumed to be a base name and generate a ContextName from that base name.

Parameters
path:String

The path that ends in a base name

Returns:ContextName

the ContextName generated from the given base name

getBaseNameback to summary
public String getBaseName()
getDisplayNameback to summary
public String getDisplayName()
getNameback to summary
public String getName()
getPathback to summary
public String getPath()
getVersionback to summary
public String getVersion()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override