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 Object
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_chunkedprotected String_connectionprotected long_contentLengthprotected String_contentTypeprotected String_hostprotected LineReader_readerprotected String_server
-
Constructor Summary
Constructors Constructor Description HTTPParser(InputStream is)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetContentLength()StringgetContentType()LineReadergetReader()protected static StringgetRest(String line, int index)booleanisChunked()protected voidparse()Parses the typical HTTP header.abstract voidparseHead(String line)voidsetInputStream(InputStream in)
-
-
-
Field Detail
-
_server
protected String _server
-
_host
protected String _host
-
_contentType
protected String _contentType
-
_connection
protected String _connection
-
_contentLength
protected long _contentLength
-
_chunked
protected boolean _chunked
-
_reader
protected LineReader _reader
-
-
Constructor Detail
-
HTTPParser
public HTTPParser(InputStream is) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getContentType
public String getContentType()
-
getContentLength
public long getContentLength()
-
isChunked
public boolean isChunked()
-
getReader
public LineReader getReader()
-
setInputStream
public void setInputStream(InputStream in)
-
parseHead
public abstract void parseHead(String line) throws IOException
- Throws:
IOException
-
parse
protected void parse() throws IOExceptionParses the typical HTTP header.- Throws:
IOException- if a connection fails or bad/incomplete request
-
-