- java.lang.Object
-
- com.github.robtimus.servlet.http.HttpServletUtils
-
public final class HttpServletUtils extends Object
A utility class for HTTP servlets.- Author:
- Rob Spoor
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
forEachHeader(HttpServletRequest request, BiConsumer<? super String,? super String> action)
Executes an action for each header in a request.static void
forEachHeader(HttpServletResponse response, BiConsumer<? super String,? super String> action)
Executes an action for each header in a response.
-
-
-
Method Detail
-
forEachHeader
public static void forEachHeader(HttpServletRequest request, BiConsumer<? super String,? super String> action)
Executes an action for each header in a request.- Parameters:
request
- The request.action
- The action to execute.- Throws:
NullPointerException
- If the request or action isnull
.
-
forEachHeader
public static void forEachHeader(HttpServletResponse response, BiConsumer<? super String,? super String> action)
Executes an action for each header in a response.- Parameters:
response
- The response.action
- The action to execute.- Throws:
NullPointerException
- If the response or action isnull
.
-
-