Class VirtualHostHelper

java.lang.Object
org.codelibs.fess.helper.VirtualHostHelper

public class VirtualHostHelper extends Object
Helper class for managing virtual host configurations and routing. This class provides functionality to handle virtual host-based routing and path resolution based on HTTP headers.
  • Constructor Details

    • VirtualHostHelper

      public VirtualHostHelper()
      Default constructor.
  • Method Details

    • getVirtualHostPath

      public org.lastaflute.web.response.next.HtmlNext getVirtualHostPath(org.lastaflute.web.response.next.HtmlNext page)
      Gets the virtual host path for the specified HTML page.
      Parameters:
      page - The HTML page to get the virtual host path for
      Returns:
      The HTML page with updated virtual host path
    • getVirtualHostBasePath

      protected String getVirtualHostBasePath(String s, org.lastaflute.web.response.next.HtmlNext page)
      Gets the base path for virtual host based on the virtual host key and page.
      Parameters:
      s - The virtual host key
      page - The HTML page
      Returns:
      The base path for the virtual host
    • getVirtualHostKey

      public String getVirtualHostKey()
      Gets the virtual host key from the current request. The key is determined by matching HTTP headers against configured virtual hosts.
      Returns:
      The virtual host key, or empty string if no match found
    • processVirtualHost

      protected <T> T processVirtualHost(Function<String,T> func, T defaultValue)
      Processes virtual host configuration by applying a function to the matched virtual host key.
      Type Parameters:
      T - The return type of the function
      Parameters:
      func - The function to apply to the virtual host key
      defaultValue - The default value to return if no virtual host matches
      Returns:
      The result of applying the function, or the default value
    • getVirtualHostPaths

      public String[] getVirtualHostPaths()
      Gets all configured virtual host paths.
      Returns:
      An array of virtual host paths