org.apache.ws.commons.tcpmon.core.filter
Class HeaderParser

java.lang.Object
  extended by org.apache.ws.commons.tcpmon.core.filter.HeaderParser

public class HeaderParser
extends Object

Utility class to parse a set of HTTP/MIME/RFC822 headers from a stream.


Constructor Summary
HeaderParser(Stream stream)
           
 
Method Summary
 boolean available()
          Check whether a header is currently available from the underlying stream.
 void change(String newValue)
          Change the value of the current header.
 void discard()
          Discard the current header.
 String getHeaderName()
          Get the name of the current header.
 String getHeaderValue()
          Get the value of the current header.
 void insert(String name, String value)
          Insert a new header in the stream.
 boolean noMoreHeaders()
           
 void skip()
          Skip the current header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderParser

public HeaderParser(Stream stream)
Method Detail

available

public boolean available()
Check whether a header is currently available from the underlying stream.

Returns:
true if a header is available

getHeaderName

public String getHeaderName()
Get the name of the current header.

Returns:
the name of the header

getHeaderValue

public String getHeaderValue()
Get the value of the current header.

Returns:
the value of the header

skip

public void skip()
Skip the current header. This will copy the current header to the next filter.


discard

public void discard()
Discard the current header.


insert

public void insert(String name,
                   String value)
Insert a new header in the stream.

Parameters:
name - the name of the header
value - the value of the header

change

public void change(String newValue)
Change the value of the current header. This will advance the position to the next header.

Parameters:
newValue -

noMoreHeaders

public boolean noMoreHeaders()


Copyright © The Apache Software Foundation. All Rights Reserved.