net.sf.j2ep.model
Class AllowedMethodHandler

java.lang.Object
  extended by net.sf.j2ep.model.AllowedMethodHandler

public class AllowedMethodHandler
extends java.lang.Object

A utility class that will be used throughout the project to process headers to filter out those not allowed by the proxy.

Author:
Anders Nyman

Constructor Summary
AllowedMethodHandler()
           
 
Method Summary
static java.lang.String getAllowHeader()
          Returns the allow methods for this proxy.
static boolean methodAllowed(org.apache.commons.httpclient.HttpMethod method)
          Checks the method to see if it's allowed
static boolean methodAllowed(java.lang.String method)
          Will check if the specified method is allowed by looking if it is included in the allowedMethods.
static java.lang.String processAllowHeader(java.lang.String allowSent)
          Will go through all the methods sent in checking to see that the method is allowed.
static void setAllowedMethods(java.lang.String allowed)
          Will set the allowed methods, both by setting the string and also by adding all the methods to the set of allowed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllowedMethodHandler

public AllowedMethodHandler()
Method Detail

processAllowHeader

public static java.lang.String processAllowHeader(java.lang.String allowSent)
Will go through all the methods sent in checking to see that the method is allowed. If it's allowed it will be included in the returned value.

Parameters:
allowSent - The header returned by the server
Returns:
The allowed headers for this request

getAllowHeader

public static java.lang.String getAllowHeader()
Returns the allow methods for this proxy.

Returns:
Allowed methods

methodAllowed

public static boolean methodAllowed(java.lang.String method)
Will check if the specified method is allowed by looking if it is included in the allowedMethods.

Parameters:
method - The method that is checked
Returns:
true if the method is allowed, false otherwise

methodAllowed

public static boolean methodAllowed(org.apache.commons.httpclient.HttpMethod method)
Checks the method to see if it's allowed

Parameters:
method - The method that is checked
Returns:
true if the method is allowed, false otherwise
See Also:
methodAllowed(String)

setAllowedMethods

public static void setAllowedMethods(java.lang.String allowed)
Will set the allowed methods, both by setting the string and also by adding all the methods to the set of allowed.

Parameters:
allowed - The list of allowed methods, should be comma separated