public class HTTPUtil extends Object
| Constructor and Description |
|---|
HTTPUtil() |
| Modifier and Type | Method and Description |
|---|---|
static IHTTPResponseMessage |
createHTTPResponseInMemoryMessage(IHTTPResponseMessage base,
byte[] body)
Create new
IHTTPResponseMessage instance |
static IHTTPResponseMessage |
createHTTPResponseInMemoryMessage(long serial,
byte[] version,
byte[] statusCode,
byte[] reasonPhrase,
byte[] body)
Create new
IHTTPResponseMessage instance |
static IHTTPResponsePushbackMessage |
createHTTPResponsePushbackMessage(IHTTPResponseMessage base,
int pushbackBufferSize)
Create new
IHTTPResponsePushbackMessage instance from base
message |
static void |
sendFailedToClient(IHTTPProxyConnection fClient,
IHTTPRequestMessage request)
Send 404 (not found) error to client
|
public static void sendFailedToClient(IHTTPProxyConnection fClient, IHTTPRequestMessage request) throws InterruptedException, IOException
fClient - target IHTTPProxyConnectionrequest - target IHTTPRequestMessageInterruptedExceptionIOExceptionpublic static IHTTPResponseMessage createHTTPResponseInMemoryMessage(IHTTPResponseMessage base, byte[] body)
IHTTPResponseMessage instancebase - the base IHTTPResponseMessage. New instance will be
generated by copying the base message.body - message body of the new instanceIHTTPResponseMessage instancepublic static IHTTPResponseMessage createHTTPResponseInMemoryMessage(long serial, byte[] version, byte[] statusCode, byte[] reasonPhrase, byte[] body)
IHTTPResponseMessage instanceserial - serial of the messageversion - version of the messagestatusCode - status code of the messagereasonPhrase - reason phrase of the messagebody - message bodyIHTTPResponseMessage instancepublic static IHTTPResponsePushbackMessage createHTTPResponsePushbackMessage(IHTTPResponseMessage base, int pushbackBufferSize)
IHTTPResponsePushbackMessage instance from base
messagebase - the base IHTTPResponseMessage. New instance will be
generated by copying the base message.pushbackBufferSize - pushback buffer size of the new
IHTTPResponsePushbackMessage instanceIHTTPResponsePushbackMessage instance