Class UserAgentHelper

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

public class UserAgentHelper extends Object
Helper class for detecting and categorizing user agent types from HTTP requests. This class analyzes the User-Agent header to determine which browser type is being used and caches the result in the request attribute for performance optimization.
  • Field Details

    • USER_AGENT

      protected static final String USER_AGENT
      The HTTP header name for User-Agent
      See Also:
    • USER_AGENT_TYPE

      protected static final String USER_AGENT_TYPE
      The request attribute key for storing cached user agent type
      See Also:
  • Constructor Details

    • UserAgentHelper

      public UserAgentHelper()
      Default constructor for UserAgentHelper.
  • Method Details

    • getUserAgentType

      public UserAgentHelper.UserAgentType getUserAgentType()
      Determines the user agent type from the current HTTP request. The method analyzes the User-Agent header to categorize the browser type and caches the result in the request attribute for subsequent calls.
      Returns:
      the detected user agent type, or OTHER if no specific type is detected