Class AS2HttpResponseHandlerSocket

java.lang.Object
com.helger.as2lib.util.http.AS2HttpResponseHandlerSocket
All Implemented Interfaces:
IAS2HttpResponseHandler

public class AS2HttpResponseHandlerSocket extends Object implements IAS2HttpResponseHandler
An implementation of IAS2HttpResponseHandler that writes an HTTP 1.1 response directly to a Socket.
Author:
Philip Helger
  • Constructor Details

    • AS2HttpResponseHandlerSocket

      public AS2HttpResponseHandlerSocket(@Nonnull Socket aSocket, boolean bQuoteHeaderValues)
  • Method Details

    • getSocket

      @Nonnull public final Socket 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

      @Nonnull @OverrideOnDemand public com.helger.http.EHttpVersion getHTTPVersion()
      Returns:
      The HTTP version to use. May not be null.
    • createOutputStream

      @Nonnull @OverrideOnDemand public OutputStream createOutputStream() throws IOException
      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 interface IAS2HttpResponseHandler
      Parameters:
      nHttpResponseCode - The HTTP response code. E.g. 200 for "HTTP OK". Must be > 0.
      aHeaders - Headers to use. May not be null.
      aData - Data to send as response body. May not be null but may be empty.
      Throws:
      IOException - In case of error