org.globus.util.http
Class HTTPParser

java.lang.Object
  extended by org.globus.util.http.HTTPParser
Direct Known Subclasses:
HTTPRequestParser, HTTPResponseParser

public abstract class HTTPParser
extends Object


Field Summary
protected  boolean _chunked
           
protected  String _connection
           
protected  long _contentLength
           
protected  String _contentType
           
protected  String _host
           
protected  LineReader _reader
           
protected  String _server
           
 
Constructor Summary
HTTPParser(InputStream is)
           
 
Method Summary
 long getContentLength()
           
 String getContentType()
           
 LineReader getReader()
           
protected static String getRest(String line, int index)
           
 boolean isChunked()
           
protected  void parse()
          Parses the typical HTTP header.
abstract  void parseHead(String line)
           
 void setInputStream(InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 IOException
Parses the typical HTTP header.

Throws:
IOException - if a connection fails or bad/incomplete request

getRest

protected static final String getRest(String line,
                                      int index)