public final static StatusLine parseStatusLine(final String value, LineParser parser) throws ParseException { if (value == null) { throw new IllegalArgumentException ("Value to parse may not be null."); } if (parser == null) parser = BasicLineParser.DEFAULT; CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); ParserCursor cursor = new ParserCursor(0, value.length()); return parser.parseStatusLine(buffer, cursor); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
public final static StatusLine parseStatusLine(final String value, LineParser parser) throws ParseException { if (value == null) { throw new IllegalArgumentException ("Value to parse may not be null."); } if (parser == null) parser = BasicLineParser.DEFAULT; CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); ParserCursor cursor = new ParserCursor(0, value.length()); return parser.parseStatusLine(buffer, cursor); }
public final static StatusLine parseStatusLine(final String value, LineParser parser) throws ParseException { if (value == null) { throw new IllegalArgumentException ("Value to parse may not be null."); } if (parser == null) parser = BasicLineParser.DEFAULT; CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); ParserCursor cursor = new ParserCursor(0, value.length()); return parser.parseStatusLine(buffer, cursor); }
public final static StatusLine parseStatusLine(final String value, LineParser parser) throws ParseException { if (value == null) { throw new IllegalArgumentException ("Value to parse may not be null."); } if (parser == null) parser = BasicLineParser.DEFAULT; CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); ParserCursor cursor = new ParserCursor(0, value.length()); return parser.parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParser.INSTANCE) .parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParser.INSTANCE) .parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParser.INSTANCE) .parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParser.INSTANCE) .parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParserHC4.INSTANCE) .parseStatusLine(buffer, cursor); }
public static StatusLine parseStatusLine(final String value, final LineParser parser) throws ParseException { Args.notNull(value, "Value"); final CharArrayBuffer buffer = new CharArrayBuffer(value.length()); buffer.append(value); final ParserCursor cursor = new ParserCursor(0, value.length()); return (parser != null ? parser : BasicLineParser.INSTANCE) .parseStatusLine(buffer, cursor); }
@Override protected HttpResponse createMessage(final CharArrayBuffer buffer) throws HttpException, ParseException { final ParserCursor cursor = new ParserCursor(0, buffer.length()); final StatusLine statusline = lineParser.parseStatusLine(buffer, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpResponse createMessage(final CharArrayBuffer buffer) throws HttpException, ParseException { final ParserCursor cursor = new ParserCursor(0, buffer.length()); final StatusLine statusline = lineParser.parseStatusLine(buffer, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); final int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); final StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpResponse parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); final int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); final StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException { this.lineBuf.clear(); final int i = sessionBuffer.readLine(this.lineBuf); if (i == -1) { throw new NoHttpResponseException("The target server failed to respond"); } //create the status line from the status string final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length()); final StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }