Class 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 Detail

      • 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.
        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.
        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()
      • extractFromPath

        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.
        path - The path that ends in a base name
        the ContextName generated from the given base name