org.apache.jmeter.protocol.http.util
Class ConversionUtils
public class ConversionUtils
General purpose conversion utilities related to HTTP/HTML
static String | getEncodingFromContentType(String contentType) - Extract the encoding (charset) from the Content-Type,
e.g.
|
static URL | makeRelativeURL(URL baseURL, String location) - Generate a relative URL, allowing for extraneous leading "../" segments.
|
getEncodingFromContentType
public static String getEncodingFromContentType(String contentType)
Extract the encoding (charset) from the Content-Type,
e.g. "text/html; charset=utf-8".
- the charset encoding - or null, if none was found or the charset is not supported
makeRelativeURL
public static URL makeRelativeURL(URL baseURL,
String location)
throws MalformedURLException
Generate a relative URL, allowing for extraneous leading "../" segments.
The Java URL.URL(URL, String)
constructor does not remove these.
baseURL
- location
- relative location, possibly with extraneous leading "../"
- URL with extraneous ../ removed
Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.