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 ofHttpServletRequest
wrappers.- Author:
- Juergen Donnerstag
-
-
Constructor Summary
Constructors Constructor Description AbstractRequestWrapperFactory()
Construct.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static 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 Stringjavax.servlet.http.HttpServletRequest
getWrapper(javax.servlet.http.HttpServletRequest request)
Wrap the given request.boolean
isEnabled()
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(javax.servlet.http.HttpServletRequest request)
abstract javax.servlet.http.HttpServletRequest
newRequestWrapper(javax.servlet.http.HttpServletRequest request)
void
setEnabled(boolean enabled)
Enable or disable the filter
-
-
-
Constructor Detail
-
AbstractRequestWrapperFactory
public AbstractRequestWrapperFactory()
Construct.
-
-
Method Detail
-
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 javax.servlet.http.HttpServletRequest getWrapper(javax.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(javax.servlet.http.HttpServletRequest request)
- Parameters:
request
-- Returns:
- True, if a wrapper is needed
-
newRequestWrapper
public abstract javax.servlet.http.HttpServletRequest newRequestWrapper(javax.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 compiledPattern
- 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 givenstr
matches at least one of the givenpatterns
.
-
-