|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.http.HTTPUtils
public final class HTTPUtils
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 float |
parseFeatureToken(java.lang.String token)
Utility method for extracting the version from a feature token. |
static void |
writeDate(java.io.OutputStream stream)
Utility method for writing the "Date" header, as specified in RFC 2616 section 14.18, to a OutputStream. |
static void |
writeDate(java.io.Writer writer)
Utility method for writing the "Date" header, as specified in RFC 2616 section 14.18, to a Writer. |
static void |
writeFeatures(java.io.OutputStream stream)
Utility method for writing the currently supported features to the OutputStream. |
static void |
writeFeatures(java.io.Writer writer)
Utility method for writing the currently supported features to the Writer. |
static void |
writeHeader(HTTPHeaderName name,
int value,
java.io.OutputStream stream)
Utility method for writing a header with an integer value. |
static void |
writeHeader(HTTPHeaderName name,
int value,
java.io.Writer writer)
Utility method for writing a header with an integer value. |
static void |
writeHeader(HTTPHeaderName name,
java.lang.String 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,
java.lang.String 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 |
---|
public static void writeHeader(HTTPHeaderName name, java.lang.String value, java.io.OutputStream os) throws java.io.IOException
name
- the HTTPHeaderName instance containing the
header name to write to the streamvalue
- the String instance containing the
header value to write to the streamos
- the OutputStream instance to write to
java.io.IOException
public static void writeHeader(HTTPHeaderName name, java.lang.String value, java.io.Writer out) throws java.io.IOException
name
- the HTTPHeaderName instance containing the
header name to write to the streamvalue
- the HTTPHeaderValue instance containing the
header value to write to the streamout
- the Writer instance to write to
java.io.IOException
public static java.lang.String extractHeaderValue(java.lang.String header)
public static void writeHeader(HTTPHeaderName name, int value, java.io.Writer writer) throws java.io.IOException
name
- the HTTPHeaderName of the header to writevalue
- the int value of the headerwriter
- the Writer instance to write the header to
java.io.IOException
- if an IO error occurs during the writepublic static void writeHeader(HTTPHeaderName name, int value, java.io.OutputStream stream) throws java.io.IOException
name
- the HTTPHeaderName of the header to writevalue
- the int value of the headerstream
- the OutputStream instance to write the header to
java.io.IOException
- if an IO error occurs during the writepublic static void writeDate(java.io.Writer writer) throws java.io.IOException
writer
- the Writer to write the header to
java.io.IOException
- if a write error occurspublic static void writeDate(java.io.OutputStream stream) throws java.io.IOException
stream
- the OutputStream to write the header to
java.io.IOException
- if a write error occurspublic static void writeFeatures(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public static void writeFeatures(java.io.OutputStream stream) throws java.io.IOException
java.io.IOException
public static float parseFeatureToken(java.lang.String token) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |