mx4j.tools.adaptor.http

Class HttpUtil

public class HttpUtil extends Object

Utility methods for the HTTP adaptor

Version: $Revision: 1.3 $

Method Summary
static booleanbooleanVariableValue(HttpInputStream in, String variable, boolean defaultValue)
Returns whether a boolean variable is in the variables.
static StringcanonicalizePath(String path)
Makes a path canonical
static StringgetCodeMessage(int code)
Gets a message apropriate for a give HTTP code
protected static intindexOf(char[] chars, int length, char chr, int from)

Method Detail

booleanVariableValue

public static boolean booleanVariableValue(HttpInputStream in, String variable, boolean defaultValue)
Returns whether a boolean variable is in the variables. It tries to find it. If not found the the default is used. If found is tested to check if it is true or 1 and the answer is true. Otherwise is false

canonicalizePath

public static String canonicalizePath(String path)
Makes a path canonical

Parameters: path Target path

Returns: The canonicalized path

getCodeMessage

public static String getCodeMessage(int code)
Gets a message apropriate for a give HTTP code

Parameters: code Reference Code

Returns: The result message

See Also: HttpConstants

indexOf

protected static int indexOf(char[] chars, int length, char chr, int from)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.