Interface VirtualHostConfig

All Superinterfaces:
Config

public interface VirtualHostConfig extends Config
Virtual Host Configuration.

A Virtual Host is part of the configuration of a File Service within a Web Server. Values may not be changed once the server has been started.

Since:
4.4
  • Method Details

    • getName

      String getName()
      Gets the virtual host name.
      Returns:
      name
    • getHost

      String getHost()
      Gets the host.
      Returns:
      host
    • getDocumentRoot

      String getDocumentRoot()
      Gets the document root.
      Returns:
      document root directory
    • getHomePage

      String getHomePage()
      Gets the home page.
      Returns:
      the home page
    • setErrorPage

      void setErrorPage(String errorPage) throws ConfigException
      Sets the error page.

      This is used to control the 404 response. The server will look for one of this files in the directory of the request, if the file does not exist, it will look for this file in the virtual directory.

      If left blank or the file doesn't exist a standard 404 response HTML document will be sent.

      Parameters:
      errorPage - the error page
      Throws:
      ConfigException - if unable to set property
    • getErrorPage

      String getErrorPage()
      Gets the error page.
      Returns:
      error page
    • setStatic

      void setStatic(boolean isStatic) throws ConfigException
      Sets static option.

      If static set to true, after loading the resource once, the file system will not be checked again. This increases performance.

      Default is false.

      Parameters:
      isStatic - true if static
      Throws:
      ConfigException - if unable to set property
    • isStatic

      boolean isStatic()
      Is static set?
      Returns:
      true if static option set
    • setMinify

      void setMinify(boolean minify) throws ConfigException
      Sets minify option.

      Minify html. This will happen before the file is compressed.

      Default is false.

      Parameters:
      minify - true to minify
      Throws:
      ConfigException - if unable to set property
    • isMinify

      boolean isMinify()
      Is minify option set?
      Returns:
      true if minify set
    • setCompressionThreshold

      void setCompressionThreshold(int threshold) throws ConfigException
      Sets the compression threshold.

      Enable compression for HTTP responses over this size.

      If not specified, 512 is assumed.

      Parameters:
      threshold - in bytes
      Throws:
      ConfigException - if unable to set property
    • getCompressionThreshold

      int getCompressionThreshold()
      Gets the compression threshold.
      Returns:
      compression threshold in bytes
    • setAliasFile

      void setAliasFile(String aliasFile) throws ConfigException
      Sets the alias file.

      Optionally specifies a file to use for URL aliasing.

      Parameters:
      aliasFile - the alias file name
      Throws:
      ConfigException - if unable to set property
    • getAliasFile

      String getAliasFile()
      Gets the alias file.
      Returns:
      alias file name or null if none set
    • getCache

      Gets the cache configuration.
      Returns:
      cache configuration.
    • getRealms

      Gets the configured Realms.
      Returns:
      list of realms
    • getRealm

      Get a named realm.
      Parameters:
      name - realm name
      Returns:
      the realm or null if not defined
    • addRealm

      VirtualHostRealmConfig addRealm(String name, String path) throws ConfigException
      Add a realm.
      Parameters:
      name - realm name
      path - realm path
      Returns:
      realm configuration
      Throws:
      ConfigException - if unable to add a realm
    • removeRealm

      VirtualHostRealmConfig removeRealm(String name) throws ConfigException
      Remove a named realm.
      Parameters:
      name - realm name
      Returns:
      realm config or null if it did not exist
      Throws:
      ConfigException - if unable to remove
    • setDebug

      void setDebug(boolean debug) throws ConfigException
      Sets debug option.

      Default is false.

      Parameters:
      debug - true to set.
      Throws:
      ConfigException - if unable to set property
    • isDebug

      boolean isDebug()
      Is debug set?
      Returns:
      true if debug set