Module org.apache.wicket.core
Class AbstractRequestWrapperFactory
java.lang.Object
org.apache.wicket.protocol.http.servlet.AbstractRequestWrapperFactory
- Direct Known Subclasses:
SecuredRemoteAddressRequestWrapperFactory
,XForwardedRequestWrapperFactory
A factory of
HttpServletRequest
wrappers.- Author:
- Juergen Donnerstag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pattern[]
commaDelimitedListToPatternArray
(String commaDelimitedPatterns) Convert a given comma delimited list of regular expressions into an array of compiledPattern
static String[]
commaDelimitedListToStringArray
(String commaDelimitedStrings) Convert a given comma delimited list of regular expressions into an array of Stringjakarta.servlet.http.HttpServletRequest
getWrapper
(jakarta.servlet.http.HttpServletRequest request) Wrap the given request.final boolean
static String
listToCommaDelimitedString
(List<String> stringList) Convert an array of strings in a comma delimited stringstatic boolean
matchesOne
(String str, Pattern... patterns) protected abstract boolean
needsWrapper
(jakarta.servlet.http.HttpServletRequest request) abstract jakarta.servlet.http.HttpServletRequest
newRequestWrapper
(jakarta.servlet.http.HttpServletRequest request) final void
setEnabled
(boolean enabled) Enable or disable the filter
-
Constructor Details
-
AbstractRequestWrapperFactory
public AbstractRequestWrapperFactory()Construct.
-
-
Method Details
-
isEnabled
- Returns:
true
if filter is enabled
-
setEnabled
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
- 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
Convert a given comma delimited list of regular expressions into an array of compiledPattern
- Parameters:
commaDelimitedPatterns
-- Returns:
- array of patterns (not
null
)
-
commaDelimitedListToStringArray
Convert a given comma delimited list of regular expressions into an array of String- Parameters:
commaDelimitedStrings
-- Returns:
- array of patterns (non
null
)
-
listToCommaDelimitedString
Convert an array of strings in a comma delimited string- Parameters:
stringList
-- Returns:
- xxx
-
matchesOne
- Parameters:
str
-patterns
-- Returns:
- Return
true
if the givenstr
matches at least one of the givenpatterns
.
-