Package com.helger.as2lib.util.http
Class AS2HttpResponseHandlerSocket
java.lang.Object
com.helger.as2lib.util.http.AS2HttpResponseHandlerSocket
- All Implemented Interfaces:
IAS2HttpResponseHandler
An implementation of
IAS2HttpResponseHandler
that writes an HTTP 1.1
response directly to a Socket
.- Author:
- Philip Helger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.helger.http.EHttpVersion
final Socket
final boolean
void
sendHttpResponse
(int nHttpResponseCode, com.helger.commons.http.HttpHeaderMap aHeaders, com.helger.commons.io.IWriteToStream aData) Added an HTTP header to the response.
-
Constructor Details
-
AS2HttpResponseHandlerSocket
-
-
Method Details
-
getSocket
- Returns:
- The socket provided in the constructor. Never
null
.
-
isQuoteHeaderHeaderValues
public final boolean isQuoteHeaderHeaderValues()- Returns:
true
if HTTP header values should be quoted,false
if not.- Since:
- 4.4.4
-
getHTTPVersion
- Returns:
- The HTTP version to use. May not be
null
.
-
createOutputStream
- Throws:
IOException
-
sendHttpResponse
public void sendHttpResponse(@Nonnegative int nHttpResponseCode, @Nonnull com.helger.commons.http.HttpHeaderMap aHeaders, @Nonnull @WillNotClose com.helger.commons.io.IWriteToStream aData) throws IOException Description copied from interface:IAS2HttpResponseHandler
Added an HTTP header to the response. This method must be called before any output is written.- Specified by:
sendHttpResponse
in interfaceIAS2HttpResponseHandler
- Parameters:
nHttpResponseCode
- The HTTP response code. E.g. 200 for "HTTP OK". Must be > 0.aHeaders
- Headers to use. May not benull
.aData
- Data to send as response body. May not benull
but may be empty.- Throws:
IOException
- In case of error
-