org.eclipse.actf.util.httpproxy.util

## Class HTTPUtil

- java.lang.Object
- - org.eclipse.actf.util.httpproxy.util.HTTPUtil

    public class HTTPUtil
    extends Object

Utility class for HTTP session and messages

### Constructor Summary

Constructors
Constructor and Description
`HTTPUtil()`

### Method Summary

Methods
`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

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HTTPUtil

    public HTTPUtil()

### Method Detail

#### sendFailedToClient

    public static void sendFailedToClient(IHTTPProxyConnection fClient,
                          IHTTPRequestMessage request)
                                   throws InterruptedException,
                                          IOException

Send 404 (not found) error to client

Parameters:
  `fClient` - target `IHTTPProxyConnection`
  `request` - target `IHTTPRequestMessage`
Throws:
  `InterruptedException`
  `IOException`

#### createHTTPResponseInMemoryMessage

    public static IHTTPResponseMessage createHTTPResponseInMemoryMessage(IHTTPResponseMessage base,
                                                         byte[] body)

Create new `IHTTPResponseMessage` instance

Parameters:
  `base` - the base `IHTTPResponseMessage`. New instance will be generated by copying the base message.
  `body` - message body of the new instance
Returns:
  new `IHTTPResponseMessage` instance

#### createHTTPResponseInMemoryMessage

    public static IHTTPResponseMessage createHTTPResponseInMemoryMessage(long serial,
                                                         byte[] version,
                                                         byte[] statusCode,
                                                         byte[] reasonPhrase,
                                                         byte[] body)

Create new `IHTTPResponseMessage` instance

Parameters:
  `serial` - serial of the message
  `version` - version of the message
  `statusCode` - status code of the message
  `reasonPhrase` - reason phrase of the message
  `body` - message body
Returns:
  new `IHTTPResponseMessage` instance

#### createHTTPResponsePushbackMessage

    public static IHTTPResponsePushbackMessage createHTTPResponsePushbackMessage(IHTTPResponseMessage base,
                                                                 int pushbackBufferSize)

Create new `IHTTPResponsePushbackMessage` instance from base message

Parameters:
  `base` - the base `IHTTPResponseMessage`. New instance will be generated by copying the base message.
  `pushbackBufferSize` - pushback buffer size of the new `IHTTPResponsePushbackMessage` instance
Returns:
  new `IHTTPResponsePushbackMessage` instance