org.apache.catalina.connector

Class CoyoteAdapter

public class CoyoteAdapter extends Object implements Adapter

Implementation of a request processor which delegates the processing to a Coyote processor.

Version: $Revision: 896389 $ $Date: 2010-01-06 12:09:55 +0100 (Wed, 06 Jan 2010) $

Author: Craig R. McClanahan Remy Maucherat

Field Summary
static intADAPTER_NOTES
protected static booleanALLOW_BACKSLASH
protected StringManagersm
The string manager for this package.
protected static URLEncoderurlEncoder
Encoder for the Location URL in HTTP redirects.
Constructor Summary
CoyoteAdapter(Connector connector)
Construct a new CoyoteProcessor associated with the specified connector.
Method Summary
static booleancheckNormalize(MessageBytes uriMB)
Check that the URI is normalized following character decoding.
protected voidconvertMB(MessageBytes mb)
Character conversion of the a US-ASCII MessageBytes.
protected voidconvertURI(MessageBytes uri, Request request)
Character conversion of the URI.
protected static voidcopyBytes(byte[] b, int dest, int src, int len)
Copy an array of bytes to a different position.
booleanevent(Request req, Response res, SocketStatus status)
Event method.
static booleannormalize(MessageBytes uriMB)
Normalize URI.
protected voidparseSessionCookiesId(Request req, Request request)
Parse session id in URL.
protected voidparseSessionId(Request req, Request request)
Parse session id in URL.
protected booleanpostParseRequest(Request req, Request request, Response res, Response response)
Parse additional request parameters.
voidservice(Request req, Response res)
Service method.

Field Detail

ADAPTER_NOTES

public static final int ADAPTER_NOTES

ALLOW_BACKSLASH

protected static final boolean ALLOW_BACKSLASH

sm

protected StringManager sm
The string manager for this package.

urlEncoder

protected static URLEncoder urlEncoder
Encoder for the Location URL in HTTP redirects.

Constructor Detail

CoyoteAdapter

public CoyoteAdapter(Connector connector)
Construct a new CoyoteProcessor associated with the specified connector.

Parameters: connector CoyoteConnector that owns this processor

Method Detail

checkNormalize

public static boolean checkNormalize(MessageBytes uriMB)
Check that the URI is normalized following character decoding.

This method checks for "\", 0, "//", "/./" and "/../". This method will return false if sequences that are supposed to be normalized are still present in the URI.

Parameters: uriMB URI to be checked (should be chars)

convertMB

protected void convertMB(MessageBytes mb)
Character conversion of the a US-ASCII MessageBytes.

convertURI

protected void convertURI(MessageBytes uri, Request request)
Character conversion of the URI.

copyBytes

protected static void copyBytes(byte[] b, int dest, int src, int len)
Copy an array of bytes to a different position. Used during normalization.

event

public boolean event(Request req, Response res, SocketStatus status)
Event method.

Returns: false to indicate an error, expected or not

normalize

public static boolean normalize(MessageBytes uriMB)
Normalize URI.

This method normalizes "\", "//", "/./" and "/../". This method will return false when trying to go above the root, or if the URI contains a null byte.

Parameters: uriMB URI to be normalized

parseSessionCookiesId

protected void parseSessionCookiesId(Request req, Request request)
Parse session id in URL.

parseSessionId

protected void parseSessionId(Request req, Request request)
Parse session id in URL.

postParseRequest

protected boolean postParseRequest(Request req, Request request, Response res, Response response)
Parse additional request parameters.

service

public void service(Request req, Response res)
Service method.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.