deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.enterprise
Class WebUtils

java.lang.Object
  extended by org.deegree.enterprise.WebUtils

public class WebUtils
extends Object

Since:
2.0
Version:
$Revision: 18195 $, 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Constructor Summary
WebUtils()
           
 
Method Summary
static org.apache.commons.httpclient.HttpClient enableProxyUsage(org.apache.commons.httpclient.HttpClient client, URL url)
          reads proxyHost and proxyPort from system parameters and sets them to the passed HttpClient instance
static String getAbsoluteContextPath(javax.servlet.http.HttpServletRequest request)
          returns the root path (address - port - context) of a web application read from the passed request
e.g. http://myserver:8080/deegree/services?
static String readCharsetFromContentType(javax.servlet.http.HttpServletRequest request)
          returns the charset read from the content type of the passed HttpServletRequest.
static String readCharsetFromContentType(String contentType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebUtils

public WebUtils()
Method Detail

getAbsoluteContextPath

public static String getAbsoluteContextPath(javax.servlet.http.HttpServletRequest request)
returns the root path (address - port - context) of a web application read from the passed request
e.g. http://myserver:8080/deegree/services?request=GetCapabilites ...
will return 'http://myserver:8080/deegree'

Parameters:
request -
Returns:
the root path (address - port - context) of a web application read from the passed request

enableProxyUsage

public static org.apache.commons.httpclient.HttpClient enableProxyUsage(org.apache.commons.httpclient.HttpClient client,
                                                                        URL url)
reads proxyHost and proxyPort from system parameters and sets them to the passed HttpClient instance

Parameters:
client -
url -
Returns:
HttpClient with proxy configuration
See Also:
of the passed, HttpClient

readCharsetFromContentType

public static String readCharsetFromContentType(javax.servlet.http.HttpServletRequest request)
returns the charset read from the content type of the passed HttpServletRequest. If no content type or no charset is defined the charset read from CharsetUtils will be returned instead. So it is gauranteed that the method will not return null

Parameters:
request -
Returns:
charset

readCharsetFromContentType

public static String readCharsetFromContentType(String contentType)
Parameters:
contentType -
Returns:
charset
See Also:
readCharsetFromContentType(HttpServletRequest)

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org