com.limegroup.gnutella.http
Class HTTPUtils

java.lang.Object
  extended bycom.limegroup.gnutella.http.HTTPUtils

public final class HTTPUtils
extends java.lang.Object

This class supplies general facilities for handling HTTP, such as writing headers, extracting header values, etc..


Method Summary
static java.lang.String extractHeaderValue(java.lang.String header)
          Parses out the header value from the HTTP header string.
static void writeHeader(HTTPHeaderName name, HTTPHeaderValue value, java.io.OutputStream os)
          Writes an single http header to the specified OutputStream instance, with the specified header name and the specified header value.
static void writeHeader(HTTPHeaderName name, HTTPHeaderValue value, java.io.Writer out)
          Writes an single http header to the specified OutputStream instance, with the specified header name and the specified header value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeHeader

public static void writeHeader(HTTPHeaderName name,
                               HTTPHeaderValue value,
                               java.io.OutputStream os)
                        throws java.io.IOException
Writes an single http header to the specified OutputStream instance, with the specified header name and the specified header value.

Parameters:
name - the HTTPHeaderName instance containing the header name to write to the stream
os - the OutputStream instance to write to
Throws:
java.io.IOException

writeHeader

public static void writeHeader(HTTPHeaderName name,
                               HTTPHeaderValue value,
                               java.io.Writer out)
                        throws java.io.IOException
Writes an single http header to the specified OutputStream instance, with the specified header name and the specified header value.

Parameters:
name - the HTTPHeaderName instance containing the header name to write to the stream
out - the Writer instance to write to
Throws:
java.io.IOException

extractHeaderValue

public static java.lang.String extractHeaderValue(java.lang.String header)
Parses out the header value from the HTTP header string.

Returns:
the header value for the specified full header string, or null if the value could not be extracted