CatalinaBaseConfigurationSource (Apache Tomcat 10.1.57 API Documentation)
Description: declaration: package: org.apache.catalina.startup, class: CatalinaBaseConfigurationSource

# Class CatalinaBaseConfigurationSource

java.lang.Object
org.apache.catalina.startup.CatalinaBaseConfigurationSource

All Implemented Interfaces:
  `ConfigurationSource`

public class CatalinaBaseConfigurationSource extends Object implements ConfigurationSource
Configuration source that loads resources from the Catalina base directory.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface ConfigurationSource

  `ConfigurationSource.Resource`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `LEGACY_SERVER_EMBED_XML`
  Legacy name for the embedded server XML configuration file.
  `protected static final StringManager`
  `sm`
  String manager for this package.

  ### Fields inherited from interface ConfigurationSource

  `DEFAULT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CatalinaBaseConfigurationSource(File catalinaBaseFile, String serverXmlPath)`
  Construct a configuration source with the specified Catalina base directory and server XML path.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ConfigurationSource.Resource`
  `getResource(String name)`
  Get a resource, not based on the conf path.
  `ConfigurationSource.Resource`
  `getServerXml()`
  Returns the contents of the main conf/server.xml file.
  `URI`
  `getURI(String name)`
  Get a URI to the given resource.

  ### Methods inherited from class Object

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

  ### Methods inherited from interface ConfigurationSource

  `getConfResource, getSharedWebXml`

- ## Field Details

  - ### sm

    protected static final StringManager sm
    String manager for this package.

  - ### LEGACY_SERVER_EMBED_XML

    public static final String LEGACY_SERVER_EMBED_XML
    Legacy name for the embedded server XML configuration file.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### CatalinaBaseConfigurationSource

    public CatalinaBaseConfigurationSource(File catalinaBaseFile, String serverXmlPath)
    Construct a configuration source with the specified Catalina base directory and server XML path.
    Parameters:
      `catalinaBaseFile` - The Catalina base directory
      `serverXmlPath` - The path to the server XML configuration file

- ## Method Details

  - ### getServerXml

    public ConfigurationSource.Resource getServerXml() throws IOException
    Description copied from interface: `ConfigurationSource`
    Returns the contents of the main conf/server.xml file.
    Specified by:
      `getServerXml` in interface `ConfigurationSource`
    Returns:
      the server.xml as an InputStream
    Throws:
      `IOException` - if an error occurs or if the resource does not exist

  - ### getResource

    public ConfigurationSource.Resource getResource(String name) throws IOException
    Description copied from interface: `ConfigurationSource`
    Get a resource, not based on the conf path.
    Specified by:
      `getResource` in interface `ConfigurationSource`
    Parameters:
      `name` - The resource name
    Returns:
      the resource
    Throws:
      `IOException` - if an error occurs or if the resource does not exist

  - ### getURI

    public URI getURI(String name)
    Description copied from interface: `ConfigurationSource`
    Get a URI to the given resource. Unlike getResource, this will also return URIs to locations where no resource exists.
    Specified by:
      `getURI` in interface `ConfigurationSource`
    Parameters:
      `name` - The resource name
    Returns:
      a URI representing the resource location