public ProtocolVersion getProtocolVersion() { return this.statusline.getProtocolVersion(); }
public void setReasonPhrase(String reason) { if ((reason != null) && ((reason.indexOf('\n') >= 0) || (reason.indexOf('\r') >= 0)) ) { throw new IllegalArgumentException("Line break in reason phrase."); } this.statusline = new BasicStatusLine(this.statusline.getProtocolVersion(), this.statusline.getStatusCode(), reason); }
public void setLocale(Locale loc) { if (loc == null) { throw new IllegalArgumentException("Locale may not be null."); } this.locale = loc; final int code = this.statusline.getStatusCode(); this.statusline = new BasicStatusLine (this.statusline.getProtocolVersion(), code, getReason(code)); }
public void setStatusCode(int code) { // argument checked in BasicStatusLine constructor ProtocolVersion ver = this.statusline.getProtocolVersion(); this.statusline = new BasicStatusLine(ver, code, getReason(code)); }
/** * Actually formats a status line. * Called from {@link #formatStatusLine}. * * @param buffer the empty buffer into which to format, * never <code>null</code> * @param statline the status line to format, never <code>null</code> */ protected void doFormatStatusLine(final CharArrayBuffer buffer, final StatusLine statline) { int len = estimateProtocolVersionLen(statline.getProtocolVersion()) + 1 + 3 + 1; // room for "HTTP/1.1 200 " final String reason = statline.getReasonPhrase(); if (reason != null) { len += reason.length(); } buffer.ensureCapacity(len); appendProtocolVersion(buffer, statline.getProtocolVersion()); buffer.append(' '); buffer.append(Integer.toString(statline.getStatusCode())); buffer.append(' '); // keep whitespace even if reason phrase is empty if (reason != null) { buffer.append(reason); } }
ProtocolVersion ver = response.getStatusLine().getProtocolVersion(); if (entity.getContentLength() < 0 && (!entity.isChunked() || ver.lessEquals(HttpVersion.HTTP_1_0))) {
throw new ProtocolException("Content-Length header already present"); ProtocolVersion ver = response.getStatusLine().getProtocolVersion(); HttpEntity entity = response.getEntity(); if (entity != null) {
ProtocolVersion ver = response.getStatusLine().getProtocolVersion(); if (entity != null) { if (entity.getContentLength() < 0) {
/** * Returns the {@link ProtocolVersion} from the origin {@link HttpResponse}. */ public ProtocolVersion getProtocolVersion() { return this.statusLine.getProtocolVersion(); }
public void consume(Map<String, String> returnResult) { int statusLine = (this.statusLine != null) ? this.statusLine.getStatusCode() : 0; returnResult.put(HttpClientService.STATUS_CODE, String.valueOf(statusLine)); String protocolVersion = (this.statusLine != null && this.statusLine.getProtocolVersion() != null) ? this.statusLine.getProtocolVersion().toString() : ""; returnResult.put(HttpClientService.PROTOCOL_VERSION, protocolVersion); String reasonPhrase = (this.statusLine != null && this.statusLine.getReasonPhrase() != null) ? this.statusLine.getReasonPhrase() : ""; returnResult.put(HttpClientService.REASON_PHRASE, reasonPhrase); } }
@Override public void setStatusLine(final StatusLine statusline) { this.statusline = Args.notNull(statusline, "Status line"); this.ver = statusline.getProtocolVersion(); this.code = statusline.getStatusCode(); this.reasonPhrase = statusline.getReasonPhrase(); }
public void setReasonPhrase(String reason) { if ((reason != null) && ((reason.indexOf('\n') >= 0) || (reason.indexOf('\r') >= 0)) ) { throw new IllegalArgumentException("Line break in reason phrase."); } this.statusline = new BasicStatusLine(this.statusline.getProtocolVersion(), this.statusline.getStatusCode(), reason); }
public void setReasonPhrase(String reason) { if ((reason != null) && ((reason.indexOf('\n') >= 0) || (reason.indexOf('\r') >= 0)) ) { throw new IllegalArgumentException("Line break in reason phrase."); } this.statusline = new BasicStatusLine(this.statusline.getProtocolVersion(), this.statusline.getStatusCode(), reason); }
@Override public void setStatusLine(final StatusLine statusline) { this.statusline = Args.notNull(statusline, "Status line"); this.ver = statusline.getProtocolVersion(); this.code = statusline.getStatusCode(); this.reasonPhrase = statusline.getReasonPhrase(); }
public void setReasonPhrase(String reason) { if ((reason != null) && ((reason.indexOf('\n') >= 0) || (reason.indexOf('\r') >= 0)) ) { throw new IllegalArgumentException("Line break in reason phrase."); } this.statusline = new BasicStatusLine(this.statusline.getProtocolVersion(), this.statusline.getStatusCode(), reason); }
@Override public void setStatusLine(final StatusLine statusline) { this.statusline = Args.notNull(statusline, "Status line"); this.ver = statusline.getProtocolVersion(); this.code = statusline.getStatusCode(); this.reasonPhrase = statusline.getReasonPhrase(); }
public void setLocale(Locale loc) { if (loc == null) { throw new IllegalArgumentException("Locale may not be null."); } this.locale = loc; final int code = this.statusline.getStatusCode(); this.statusline = new BasicStatusLine (this.statusline.getProtocolVersion(), code, getReason(code)); }
public void setLocale(Locale loc) { if (loc == null) { throw new IllegalArgumentException("Locale may not be null."); } this.locale = loc; final int code = this.statusline.getStatusCode(); this.statusline = new BasicStatusLine (this.statusline.getProtocolVersion(), code, getReason(code)); }
public void setStatusCode(int code) { // argument checked in BasicStatusLine constructor ProtocolVersion ver = this.statusline.getProtocolVersion(); this.statusline = new BasicStatusLine(ver, code, getReason(code)); }
public void setStatusCode(int code) { // argument checked in BasicStatusLine constructor ProtocolVersion ver = this.statusline.getProtocolVersion(); this.statusline = new BasicStatusLine(ver, code, getReason(code)); }