|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.jetty.HttpParser
public class HttpParser
Nested Class Summary | |
---|---|
static class |
HttpParser.EventHandler
|
static class |
HttpParser.Input
|
Field Summary | |
---|---|
protected int |
_chunkLength
|
protected int |
_chunkPosition
|
protected long |
_contentLength
|
protected long |
_contentPosition
|
protected byte |
_eol
|
protected int |
_length
|
protected int |
_state
|
static int |
STATE_CHUNK
|
static int |
STATE_CHUNK_PARAMS
|
static int |
STATE_CHUNK_SIZE
|
static int |
STATE_CHUNKED_CONTENT
|
static int |
STATE_CONTENT
|
static int |
STATE_END
|
static int |
STATE_END0
|
static int |
STATE_END1
|
static int |
STATE_EOF_CONTENT
|
static int |
STATE_FIELD0
|
static int |
STATE_FIELD1
|
static int |
STATE_FIELD2
|
static int |
STATE_HEADER
|
static int |
STATE_HEADER_IN_NAME
|
static int |
STATE_HEADER_IN_VALUE
|
static int |
STATE_HEADER_NAME
|
static int |
STATE_HEADER_VALUE
|
static int |
STATE_SPACE1
|
static int |
STATE_SPACE2
|
static int |
STATE_START
|
Constructor Summary | |
---|---|
HttpParser(Buffer buffer,
HttpParser.EventHandler handler)
Constructor. |
|
HttpParser(Buffers buffers,
EndPoint endp,
HttpParser.EventHandler handler,
int headerBufferSize,
int contentBufferSize)
Constructor. |
Method Summary | |
---|---|
long |
fill()
fill the buffers from the endpoint |
Buffer |
getBodyBuffer()
|
long |
getContentLength()
|
long |
getContentRead()
|
Buffer |
getHeaderBuffer()
|
int |
getState()
|
boolean |
inContentState()
|
boolean |
inHeaderState()
|
boolean |
isChunking()
|
boolean |
isComplete()
|
boolean |
isIdle()
|
boolean |
isMoreInBuffer()
|
boolean |
isState(int state)
|
void |
parse()
Parse until END state. |
long |
parseAvailable()
Parse until END state. |
long |
parseNext()
Parse until next Event. |
void |
reset(boolean returnBuffers)
|
void |
setForceContentBuffer(boolean force)
|
void |
setState(int state)
|
void |
skipCRLF()
Skip any CRLFs in buffers |
String |
toString()
|
String |
toString(Buffer buf)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STATE_START
public static final int STATE_FIELD0
public static final int STATE_SPACE1
public static final int STATE_FIELD1
public static final int STATE_SPACE2
public static final int STATE_END0
public static final int STATE_END1
public static final int STATE_FIELD2
public static final int STATE_HEADER
public static final int STATE_HEADER_NAME
public static final int STATE_HEADER_IN_NAME
public static final int STATE_HEADER_VALUE
public static final int STATE_HEADER_IN_VALUE
public static final int STATE_END
public static final int STATE_EOF_CONTENT
public static final int STATE_CONTENT
public static final int STATE_CHUNKED_CONTENT
public static final int STATE_CHUNK_SIZE
public static final int STATE_CHUNK_PARAMS
public static final int STATE_CHUNK
protected int _state
protected byte _eol
protected int _length
protected long _contentLength
protected long _contentPosition
protected int _chunkLength
protected int _chunkPosition
Constructor Detail |
---|
public HttpParser(Buffer buffer, HttpParser.EventHandler handler)
public HttpParser(Buffers buffers, EndPoint endp, HttpParser.EventHandler handler, int headerBufferSize, int contentBufferSize)
headerBufferSize
- size in bytes of header buffercontentBufferSize
- size in bytes of content bufferMethod Detail |
---|
public long getContentLength()
public long getContentRead()
public int getState()
public boolean inContentState()
public boolean inHeaderState()
public boolean isChunking()
public boolean isIdle()
isIdle
in interface Parser
public boolean isComplete()
isComplete
in interface Parser
public boolean isMoreInBuffer() throws IOException
isMoreInBuffer
in interface Parser
IOException
public boolean isState(int state)
public void parse() throws IOException
END
state.
If the parser is already in the END state, then it is reset
and re-parsed.
IllegalStateException
- If the buffers have already been partially parsed.
IOException
public long parseAvailable() throws IOException
current state
of the parser.
parseAvailable
in interface Parser
IOException
parse()
,
parseNext()
public long parseNext() throws IOException
IOException
public long fill() throws IOException
IOException
public void skipCRLF()
public void reset(boolean returnBuffers)
reset
in interface Parser
public void setState(int state)
public String toString(Buffer buf)
public String toString()
toString
in class Object
public Buffer getHeaderBuffer()
public Buffer getBodyBuffer()
public void setForceContentBuffer(boolean force)
force
- True if a new buffer will be forced to be used for content and the header buffer will not be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |