public String toString() { return this.buffer.toString(); }
public String toString() { // no need for non-default formatting in toString() return BasicLineFormatter.DEFAULT .formatStatusLine(null, this).toString(); }
/** * Returns a {@link String} representation of the header. * * @return a string */ public String toString() { // no need for non-default formatting in toString() return BasicLineFormatter.DEFAULT.formatHeader(null, this).toString(); }
public String toString() { // no need for non-default formatting in toString() return BasicLineFormatter.DEFAULT .formatRequestLine(null, this).toString(); }
/** * Formats a request line. * * @param reqline the request line to format * @param formatter the formatter to use, or * <code>null</code> for the * {@link #DEFAULT default} * * @return the formatted request line */ public final static String formatRequestLine(final RequestLine reqline, LineFormatter formatter) { if (formatter == null) formatter = BasicLineFormatter.DEFAULT; return formatter.formatRequestLine(null, reqline).toString(); }
/** * Formats a header. * * @param header the header to format * @param formatter the formatter to use, or * <code>null</code> for the * {@link #DEFAULT default} * * @return the formatted header */ public final static String formatHeader(final Header header, LineFormatter formatter) { if (formatter == null) formatter = BasicLineFormatter.DEFAULT; return formatter.formatHeader(null, header).toString(); }
/** * Formats a status line. * * @param statline the status line to format * @param formatter the formatter to use, or * <code>null</code> for the * {@link #DEFAULT default} * * @return the formatted status line */ public final static String formatStatusLine(final StatusLine statline, LineFormatter formatter) { if (formatter == null) formatter = BasicLineFormatter.DEFAULT; return formatter.formatStatusLine(null, statline).toString(); }
/** * Formats a protocol version. * * @param version the protocol version to format * @param formatter the formatter to use, or * <code>null</code> for the * {@link #DEFAULT default} * * @return the formatted protocol version */ public final static String formatProtocolVersion(final ProtocolVersion version, LineFormatter formatter) { if (formatter == null) formatter = BasicLineFormatter.DEFAULT; return formatter.appendProtocolVersion(null, version).toString(); }
/** * Formats a header element. * * @param elem the header element to format * @param quote <code>true</code> to always format with quoted values, * <code>false</code> to use quotes only when necessary * @param formatter the formatter to use, or <code>null</code> * for the {@link #DEFAULT default} * * @return the formatted header element */ public final static String formatHeaderElement(final HeaderElement elem, boolean quote, HeaderValueFormatter formatter) { if (formatter == null) formatter = BasicHeaderValueFormatter.DEFAULT; return formatter.formatHeaderElement(null, elem, quote).toString(); }
/** * Formats a name-value pair. * * @param nvp the name-value pair to format * @param quote <code>true</code> to always format with a quoted value, * <code>false</code> to use quotes only when necessary * @param formatter the formatter to use, or <code>null</code> * for the {@link #DEFAULT default} * * @return the formatted name-value pair */ public final static String formatNameValuePair(final NameValuePair nvp, final boolean quote, HeaderValueFormatter formatter) { if (formatter == null) formatter = BasicHeaderValueFormatter.DEFAULT; return formatter.formatNameValuePair(null, nvp, quote).toString(); }
/** * Formats an array of header elements. * * @param elems the header elements to format * @param quote <code>true</code> to always format with quoted values, * <code>false</code> to use quotes only when necessary * @param formatter the formatter to use, or <code>null</code> * for the {@link #DEFAULT default} * * @return the formatted header elements */ public final static String formatElements(final HeaderElement[] elems, final boolean quote, HeaderValueFormatter formatter) { if (formatter == null) formatter = BasicHeaderValueFormatter.DEFAULT; return formatter.formatElements(null, elems, quote).toString(); }
/** * Formats a set of parameters. * * @param nvps the parameters to format * @param quote <code>true</code> to always format with quoted values, * <code>false</code> to use quotes only when necessary * @param formatter the formatter to use, or <code>null</code> * for the {@link #DEFAULT default} * * @return the formatted parameters */ public final static String formatParameters(final NameValuePair[] nvps, final boolean quote, HeaderValueFormatter formatter) { if (formatter == null) formatter = BasicHeaderValueFormatter.DEFAULT; return formatter.formatParameters(null, nvps, quote).toString(); }
public String readLine() throws IOException { CharArrayBuffer charbuffer = new CharArrayBuffer(64); int l = readLine(charbuffer); if (l != -1) { return charbuffer.toString(); } else { return null; } }
public String toString() { // don't call complex default formatting for a simple toString if (this.value == null) { return name; } else { int len = this.name.length() + 1 + this.value.length(); CharArrayBuffer buffer = new CharArrayBuffer(len); buffer.append(this.name); if(!noValueParam) { buffer.append("="); buffer.append(this.value); } return buffer.toString(); } }
/** * Get a string representation of this pair. * * @return A string representation. */ public String toString() { // don't call complex default formatting for a simple toString int len = this.name.length(); if (this.value != null) len += 1 + this.value.length(); CharArrayBuffer buffer = new CharArrayBuffer(len); buffer.append(this.name); if (this.value != null) { buffer.append("="); buffer.append(this.value); } return buffer.toString(); }
/** * Obtains the host string, without scheme prefix. * * @return the host string, for example <code>localhost:8080</code> */ public String toHostString() { CharArrayBuffer buffer = new CharArrayBuffer(32); buffer.append(this.hostname); if (this.port != -1) { buffer.append(':'); buffer.append(Integer.toString(this.port)); } return buffer.toString(); }
public String toString() { CharArrayBuffer buffer = new CharArrayBuffer(16); buffer.append('['); buffer.append(Integer.toString(this.lowerBound)); buffer.append('>'); buffer.append(Integer.toString(this.pos)); buffer.append('>'); buffer.append(Integer.toString(this.upperBound)); buffer.append(']'); return buffer.toString(); }
/** * Converts this protocol version to a string. * * @return a protocol version string, like "HTTP/1.1" */ public String toString() { CharArrayBuffer buffer = new CharArrayBuffer(16); buffer.append(this.protocol); buffer.append('/'); buffer.append(Integer.toString(this.major)); buffer.append('.'); buffer.append(Integer.toString(this.minor)); return buffer.toString(); }
/** * Return the host URI, as a string. * * @return the host URI */ public String toURI() { CharArrayBuffer buffer = new CharArrayBuffer(32); buffer.append(this.schemeName); buffer.append("://"); buffer.append(this.hostname); if (this.port != -1) { buffer.append(':'); buffer.append(Integer.toString(this.port)); } return buffer.toString(); }
public String toString() { CharArrayBuffer buffer = new CharArrayBuffer(64); buffer.append(this.name); if (this.value != null) { buffer.append("="); buffer.append(this.value); } for (int i = 0; i < this.parameters.length; i++) { buffer.append("; "); buffer.append(this.parameters[i]); } return buffer.toString(); }