All Packages Class Hierarchy This Package Previous Next Index
Class sun.servlet.http.HttpRequestLine
java.lang.Object
|
+----sun.servlet.util.Ascii
|
+----sun.servlet.http.HttpRequestLine
- public class HttpRequestLine
- extends Ascii
This class represents the first line of an HTTP server request.
-
buf
- The request line buffer.
-
line
- The entire request line.
-
MAXLINE
- The maximum size of a request line.
-
method
- The request method.
-
params
- Hashtable of the name=value pairs encoded in the query string.
-
path
- The request path.
-
protocol
- The protocol for the request.
-
proxy
- Set to true if proxy request.
-
query
- The query string for the request.
-
size
- The request line buffer size.
-
uri
- The request URI.
-
HttpRequestLine()
- Creates a new object with a default request line buffer size.
-
HttpRequestLine(int)
- Creates a new object with the specified request line buffer size.
-
dump(PrintStream)
- Print debug information.
-
getMethod()
- Returns the request method.
-
getParameter(String)
- Returns the value of the specified query string parameter.
-
getParameterNames()
- Returns an enumeration of the query parameter names.
-
getParameters()
- Returns the hashtable of query parameters for this request.
-
getProtocol()
- Returns the protocol for the request.
-
getQueryString()
- Returns the query string for the request.
-
getRequestLine()
- Returns the entire request line.
-
getRequestPath()
- Get the requst path bytes
-
getURI()
- Returns the request URI.
-
isFullRequest()
- Returns true if this is a full (i.e.
-
isProxyRequest()
- Returns true if this is a proxy request.
-
parse(byte[], int, int)
- Parses an HTTP request line from the specified subarray of bytes.
-
parse(ServletInputStream)
- Parse a new request line from the specified input stream.
-
reset()
- Resets RequestLine object to an uninitialized state.
-
toString()
- Returns a string representing the request line.
-
write(OutputStream)
- Writes the request line to the specified output stream.
MAXLINE
protected final static int MAXLINE
- The maximum size of a request line.
buf
protected byte buf[]
- The request line buffer.
size
protected int size
- The request line buffer size.
line
protected final MessageBytes line
- The entire request line.
method
protected final MessageBytes method
- The request method.
uri
protected final MessageBytes uri
- The request URI.
path
protected final MessageBytes path
- The request path.
query
protected final MessageBytes query
- The query string for the request.
protocol
protected final MessageBytes protocol
- The protocol for the request.
params
protected Hashtable params
- Hashtable of the name=value pairs encoded in the query string.
proxy
protected boolean proxy
- Set to true if proxy request.
HttpRequestLine
public HttpRequestLine(int size)
- Creates a new object with the specified request line buffer size.
- Parameters:
- size - the size of the request line buffer
HttpRequestLine
public HttpRequestLine()
- Creates a new object with a default request line buffer size.
reset
public void reset()
- Resets RequestLine object to an uninitialized state.
parse
public boolean parse(ServletInputStream in) throws IOException, IllegalArgumentException
- Parse a new request line from the specified input stream. Returns
true if the line could be read, otherwise returns false if the line
could not be read because the end of the stream was reached.
- Parameters:
- in - the servlet input stream
- Throws: IOException
- if an I/O error has occurred
- Throws: IllegalArgumentException
- if the request line was invalid
parse
protected void parse(byte b[],
int off,
int len) throws IllegalArgumentException
- Parses an HTTP request line from the specified subarray of bytes.
The line is expected to be terminated with a '\n' character.
- Throws: IllegalArgumentException
- if the request line was invalid
getMethod
public MessageBytes getMethod()
- Returns the request method.
getProtocol
public MessageBytes getProtocol()
- Returns the protocol for the request.
getQueryString
public MessageBytes getQueryString()
- Returns the query string for the request.
getURI
public MessageBytes getURI()
- Returns the request URI.
getRequestPath
public MessageBytes getRequestPath()
- Get the requst path bytes
getRequestLine
public MessageBytes getRequestLine()
- Returns the entire request line.
isFullRequest
public boolean isFullRequest()
- Returns true if this is a full (i.e. not HTTP/0.9) request.
isProxyRequest
public boolean isProxyRequest()
- Returns true if this is a proxy request.
getParameter
public String getParameter(String name)
- Returns the value of the specified query string parameter.
getParameterNames
public Enumeration getParameterNames()
- Returns an enumeration of the query parameter names.
getParameters
protected Hashtable getParameters()
- Returns the hashtable of query parameters for this request.
toString
public String toString()
- Returns a string representing the request line.
- Overrides:
- toString in class Object
write
public void write(OutputStream out) throws IOException
- Writes the request line to the specified output stream.
- Parameters:
- out - the output stream
- Throws: IOException
- if an I/O error has occurred
dump
public void dump(PrintStream out)
- Print debug information.
All Packages Class Hierarchy This Package Previous Next Index