Package org.globus.util.http
Class HTTPParser
- java.lang.Object
-
- org.globus.util.http.HTTPParser
-
- Direct Known Subclasses:
HTTPRequestParser,HTTPResponseParser
public abstract class HTTPParser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_chunkedprotected java.lang.String_connectionprotected long_contentLengthprotected java.lang.String_contentTypeprotected java.lang.String_hostprotected LineReader_readerprotected java.lang.String_server
-
Constructor Summary
Constructors Constructor Description HTTPParser(java.io.InputStream is)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetContentLength()java.lang.StringgetContentType()LineReadergetReader()protected static java.lang.StringgetRest(java.lang.String line, int index)booleanisChunked()protected voidparse()Parses the typical HTTP header.abstract voidparseHead(java.lang.String line)voidsetInputStream(java.io.InputStream in)
-
-
-
Field Detail
-
_server
protected java.lang.String _server
-
_host
protected java.lang.String _host
-
_contentType
protected java.lang.String _contentType
-
_connection
protected java.lang.String _connection
-
_contentLength
protected long _contentLength
-
_chunked
protected boolean _chunked
-
_reader
protected LineReader _reader
-
-
Method Detail
-
getContentType
public java.lang.String getContentType()
-
getContentLength
public long getContentLength()
-
isChunked
public boolean isChunked()
-
getReader
public LineReader getReader()
-
setInputStream
public void setInputStream(java.io.InputStream in)
-
parseHead
public abstract void parseHead(java.lang.String line) throws java.io.IOException- Throws:
java.io.IOException
-
parse
protected void parse() throws java.io.IOExceptionParses the typical HTTP header.- Throws:
java.io.IOException- if a connection fails or bad/incomplete request
-
getRest
protected static final java.lang.String getRest(java.lang.String line, int index)
-
-