public class ProxyUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addVia(io.netty.handler.codec.http.HttpMessage msg)
Adds the Via header to specify that the message has passed through the
proxy.
|
static io.netty.handler.codec.http.HttpResponse |
copyMutableResponseFields(io.netty.handler.codec.http.HttpResponse original)
Make a copy of the response including all mutable fields.
|
static boolean |
extractBooleanDefaultFalse(Properties props,
String key) |
static boolean |
extractBooleanDefaultTrue(Properties props,
String key) |
static int |
extractInt(Properties props,
String key) |
static String |
formatDate(Date date)
Formats the given date according to the RFC 1123 pattern.
|
static String |
formatDate(Date date,
String pattern)
Formats the given date according to the specified pattern.
|
static String |
httpDate()
Creates a Date formatted for HTTP headers for the current time.
|
static boolean |
isChunked(io.netty.handler.codec.http.HttpObject httpObject)
If an HttpObject is not the last chunk, then that means there are other
chunks that will follow.
|
static boolean |
isCONNECT(io.netty.handler.codec.http.HttpObject httpObject) |
static boolean |
isFalse(String val)
Returns
true if the specified string is either "false" or
"off" ignoring case. |
static boolean |
isLastChunk(io.netty.handler.codec.http.HttpObject httpObject)
If an HttpObject implements the market interface LastHttpContent, it
represents the last chunk of a transfer.
|
static boolean |
isTrue(String val)
Returns
true if the specified string is either "true" or
"on" ignoring case. |
static String |
parseHostAndPort(io.netty.handler.codec.http.HttpRequest httpRequest)
Parses the host and port an HTTP request is being sent to.
|
static String |
parseHostAndPort(String uri)
Parses the host and port an HTTP request is being sent to.
|
static String |
stripHost(String uri)
Strips the host from a URI string.
|
public static String stripHost(String uri)
uri - The URI to transform.public static String formatDate(Date date)
date - The date to format.PATTERN_RFC1123public static String formatDate(Date date, String pattern)
simple date
format class.date - The date to format.pattern - The pattern to use for formatting the date.IllegalArgumentException - If the given date pattern is invalid.SimpleDateFormatpublic static String httpDate()
public static boolean isLastChunk(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - LastHttpContentpublic static boolean isChunked(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - FullHttpMessagepublic static String parseHostAndPort(io.netty.handler.codec.http.HttpRequest httpRequest)
httpRequest - The request.public static String parseHostAndPort(String uri)
uri - The URI.public static io.netty.handler.codec.http.HttpResponse copyMutableResponseFields(io.netty.handler.codec.http.HttpResponse original)
original - The original response to copy from.public static void addVia(io.netty.handler.codec.http.HttpMessage msg)
msg - The HTTP message.public static boolean isTrue(String val)
true if the specified string is either "true" or
"on" ignoring case.val - The string in question.true if the specified string is either "true" or
"on" ignoring case, otherwise false.public static boolean isFalse(String val)
true if the specified string is either "false" or
"off" ignoring case.val - The string in question.true if the specified string is either "false" or
"off" ignoring case, otherwise false.public static boolean extractBooleanDefaultFalse(Properties props, String key)
public static boolean extractBooleanDefaultTrue(Properties props, String key)
public static int extractInt(Properties props, String key)
public static boolean isCONNECT(io.netty.handler.codec.http.HttpObject httpObject)
Copyright © 2009-2013 LittleShoot. All Rights Reserved.