Class AbstractRequestWrapperFactory

java.lang.Object
org.apache.wicket.protocol.http.servlet.AbstractRequestWrapperFactory
Direct Known Subclasses:
SecuredRemoteAddressRequestWrapperFactory, XForwardedRequestWrapperFactory

public abstract class AbstractRequestWrapperFactory extends Object
A factory of HttpServletRequest wrappers.
Author:
Juergen Donnerstag
  • Constructor Details

  • Method Details

    • isEnabled

      public final boolean isEnabled()
      Returns:
      true if filter is enabled
    • setEnabled

      public final void setEnabled(boolean enabled)
      Enable or disable the filter
      Parameters:
      enabled -
    • getWrapper

      public jakarta.servlet.http.HttpServletRequest getWrapper(jakarta.servlet.http.HttpServletRequest request)
      Wrap the given request.
      Parameters:
      request - request to wrap
      Returns:
      Either return the request itself, or if needed a wrapper for the request
    • needsWrapper

      protected abstract boolean needsWrapper(jakarta.servlet.http.HttpServletRequest request)
      Parameters:
      request -
      Returns:
      True, if a wrapper is needed
    • newRequestWrapper

      public abstract jakarta.servlet.http.HttpServletRequest newRequestWrapper(jakarta.servlet.http.HttpServletRequest request)
      Parameters:
      request -
      Returns:
      Create a wrapper for the request
    • commaDelimitedListToPatternArray

      public static Pattern[] commaDelimitedListToPatternArray(String commaDelimitedPatterns)
      Convert a given comma delimited list of regular expressions into an array of compiled Pattern
      Parameters:
      commaDelimitedPatterns -
      Returns:
      array of patterns (not null)
    • commaDelimitedListToStringArray

      public static String[] commaDelimitedListToStringArray(String commaDelimitedStrings)
      Convert a given comma delimited list of regular expressions into an array of String
      Parameters:
      commaDelimitedStrings -
      Returns:
      array of patterns (non null)
    • listToCommaDelimitedString

      public static String listToCommaDelimitedString(List<String> stringList)
      Convert an array of strings in a comma delimited string
      Parameters:
      stringList -
      Returns:
      xxx
    • matchesOne

      public static boolean matchesOne(String str, Pattern... patterns)
      Parameters:
      str -
      patterns -
      Returns:
      Return true if the given str matches at least one of the given patterns.