Package org.codelibs.fess.helper
Class VirtualHostHelper
java.lang.Object
org.codelibs.fess.helper.VirtualHostHelper
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetVirtualHostBasePath(String s, org.lastaflute.web.response.next.HtmlNext page) Gets the base path for virtual host based on the virtual host key and page.Gets the virtual host key from the current request.org.lastaflute.web.response.next.HtmlNextgetVirtualHostPath(org.lastaflute.web.response.next.HtmlNext page) Gets the virtual host path for the specified HTML page.String[]Gets all configured virtual host paths.protected <T> TprocessVirtualHost(Function<String, T> func, T defaultValue) Processes virtual host configuration by applying a function to the matched virtual host key.
-
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
Gets the base path for virtual host based on the virtual host key and page.- Parameters:
s- The virtual host keypage- The HTML page- Returns:
- The base path for the virtual host
-
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
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 keydefaultValue- The default value to return if no virtual host matches- Returns:
- The result of applying the function, or the default value
-
getVirtualHostPaths
Gets all configured virtual host paths.- Returns:
- An array of virtual host paths
-