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 java.lang.Object


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

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
Constructor Detail

HTTPParser

public HTTPParser(java.io.InputStream is)
           throws java.io.IOException
Throws:
java.io.IOException
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.IOException
Parses 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)