public DefaultHttpResponseParserFactory( final LineParser lineParser, final HttpResponseFactory responseFactory) { super(); this.lineParser = lineParser != null ? lineParser : BasicLineParserHC4.INSTANCE; this.responseFactory = responseFactory != null ? responseFactory : DefaultHttpResponseFactoryHC4.INSTANCE; }
public DefaultHttpResponseParserFactory(final LineParser lineParser, final HttpResponseFactory responseFactory) { super(); this.lineParser = lineParser != null ? lineParser : BasicLineParserHC4.INSTANCE; this.responseFactory = responseFactory != null ? responseFactory : DefaultHttpResponseFactoryHC4.INSTANCE; }
public DefaultHttpRequestParserFactory(final LineParser lineParser, final HttpRequestFactory requestFactory) { super(); this.lineParser = lineParser != null ? lineParser : BasicLineParserHC4.INSTANCE; this.requestFactory = requestFactory != null ? requestFactory : DefaultHttpRequestFactoryHC4.INSTANCE; }
/** * Creates an instance of AbstractMessageParserHC4. * * @param buffer the session input buffer. * @param parser the line parser. * @param params HTTP parameters. * * @deprecated (4.3) use {@link AbstractMessageParserHC4#AbstractMessageParserHC4(SessionInputBuffer, * LineParser, MessageConstraints)} */ @Deprecated public AbstractMessageParserHC4( final SessionInputBuffer buffer, final LineParser parser, final HttpParams params) { super(); Args.notNull(buffer, "Session input buffer"); Args.notNull(params, "HTTP parameters"); this.sessionBuffer = buffer; this.messageConstraints = HttpParamConfig.getMessageConstraints(params); this.lineParser = (parser != null) ? parser : BasicLineParserHC4.INSTANCE; this.headerLines = new ArrayList<CharArrayBuffer>(); this.state = HEAD_LINE; }
/** * Creates new instance of AbstractMessageParserHC4. * * @param buffer the session input buffer. * @param lineParser the line parser. If <code>null</code> {@link BasicLineParserHC4#INSTANCE} * will be used. * @param constraints the message constraints. If <code>null</code> * {@link MessageConstraints#DEFAULT} will be used. * * @since 4.3 */ public AbstractMessageParserHC4( final SessionInputBuffer buffer, final LineParser lineParser, final MessageConstraints constraints) { super(); this.sessionBuffer = Args.notNull(buffer, "Session input buffer"); this.lineParser = lineParser != null ? lineParser : BasicLineParserHC4.INSTANCE; this.messageConstraints = constraints != null ? constraints : MessageConstraints.DEFAULT; this.headerLines = new ArrayList<CharArrayBuffer>(); this.state = HEAD_LINE; }
/** * Parses HTTP headers from the data receiver stream according to the generic * format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3. * * @param inbuffer Session input buffer * @param maxHeaderCount maximum number of headers allowed. If the number * of headers received from the data stream exceeds maxCount value, an * IOException will be thrown. Setting this parameter to a negative value * or zero will disable the check. * @param maxLineLen maximum number of characters for a header line, * including the continuation lines. Setting this parameter to a negative * value or zero will disable the check. * @return array of HTTP headers * @param parser line parser to use. Can be <code>null</code>, in which case * the default implementation of this interface will be used. * * @throws IOException in case of an I/O error * @throws HttpException in case of HTTP protocol violation */ public static Header[] parseHeaders( final SessionInputBuffer inbuffer, final int maxHeaderCount, final int maxLineLen, final LineParser parser) throws HttpException, IOException { final List<CharArrayBuffer> headerLines = new ArrayList<CharArrayBuffer>(); return parseHeaders(inbuffer, maxHeaderCount, maxLineLen, parser != null ? parser : BasicLineParserHC4.INSTANCE, headerLines); }