com.cafesoft.core.http
Class HttpUtils

java.lang.Object
  |
  +--com.cafesoft.core.http.HttpUtils

public class HttpUtils
extends Object

Provides some useful static methods for processing HTTP requests.

Since:
3/21/02

Constructor Summary
HttpUtils()
           
 
Method Summary
static boolean isValidRelativeUrl(String url)
          Checks if the specified relative url is valid.
static boolean isValidUrl(String url)
          Determines if the specified url is valid.
static HashMap parseQueryString(String queryString)
          Parse a url-encoded Http GET or Http POST Query String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

isValidUrl

public static boolean isValidUrl(String url)
Determines if the specified url is valid. The Url can be either absolute or relative. If absolute the protocol must be http.

Parameters:
url - the url to check
Returns:
true if the url is valid, false otherwise

isValidRelativeUrl

public static boolean isValidRelativeUrl(String url)
Checks if the specified relative url is valid. The relative url must begin with a /.

Parameters:
url - the relative url to check
Returns:
true if the relative url is valid, false otherwise

parseQueryString

public static HashMap parseQueryString(String queryString)
Parse a url-encoded Http GET or Http POST Query String.

Parameters:
queryString - the HTTP Query String.
Returns:
a Hashtable containing name/value pairs for each parameter int the query string.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.