ContextName (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.util

## Class ContextName

- java.lang.Object
- - org.apache.catalina.util.ContextName

-     public final class ContextName
      extends Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContextName(String name)` Deprecated. Use `ContextName(String, boolean)`
    `ContextName(String name, boolean stripFileExtension)` Creates an instance from a context name, display name, base name, directory name, WAR name or context.xml name.
    `ContextName(String path, String version)` Construct an instance from a path and version.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBaseName()`
    `String` | `getDisplayName()`
    `String` | `getName()`
    `String` | `getPath()`
    `String` | `getVersion()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ContextName

          @Deprecated
          public ContextName(String name)

      Deprecated. Use `ContextName(String, boolean)`
      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

    - #### ContextName

          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` - 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?

    - #### ContextName

          public ContextName(String path,
                     String version)

      Construct an instance from a path and version.
      Parameters:
        `path` - Context path to use
        `version` - Context version to use

  - ### Method Detail

    - #### getBaseName

          public String getBaseName()

    - #### getPath

          public String getPath()

    - #### getVersion

          public String getVersion()

    - #### getName

          public String getName()

    - #### getDisplayName

          public String getDisplayName()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.