| java.lang.Object org.apache.cocoon.util.NetUtils
NetUtils | public class NetUtils (Code) | | A collection of File , URL and filename
utility methods
author: Stefano Mazzocchi version: CVS $Id: NetUtils.java 433543 2006-08-22 06:22:54Z crossley $ |
absolutize | public static String absolutize(String path, String resource)(Code) | | Absolutize a relative resource path on the given absolute base path.
Parameters: path - The absolute base path Parameters: resource - The relative resource path The absolutized resource path |
createParameters | public static SourceParameters createParameters(Request request)(Code) | | Create new SourceParameters with the same
parameters as the current request
|
decodePath | public static String decodePath(String path)(Code) | | Decode a path.
Interprets %XX (where XX is hexadecimal number) as UTF-8 encoded bytes.
The validity of the input path is not checked (i.e. characters that were not encoded will
not be reported as errors).
This method differs from URLDecoder.decode in that it always uses UTF-8 (while URLDecoder
uses the platform default encoding, often ISO-8859-1), and doesn't translate + characters to spaces.
Parameters: path - the path to decode the decoded path |
deparameterize | public static String deparameterize(String uri, Map parameters)(Code) | | Remove parameters from a uri.
Resulting Map will have either String for single value attributes,
or String arrays for multivalue attributes.
Parameters: uri - The uri path to deparameterize. Parameters: parameters - The map that collects parameters. The cleaned uri |
encodePath | public static String encodePath(String path)(Code) | | Encode a path as required by the URL specification (
RFC 1738). This differs from java.net.URLEncoder.encode() which encodes according
to the x-www-form-urlencoded MIME format.
Parameters: path - the path to encode the encoded path |
getExtension | public static String getExtension(String uri)(Code) | | Remove path and file information from a filename returning only its
extension component
Parameters: uri - The filename The filename extension (with starting dot!) or null if filename extension is not found |
getPath | public static String getPath(String uri)(Code) | | Returns the path of the given resource.
Parameters: uri - The URI of the resource the resource path |
normalize | public static String normalize(String uri)(Code) | | Normalize a uri containing ../ and ./ paths.
Parameters: uri - The uri path to normalize The normalized uri |
parameterize | public static String parameterize(String uri, Map parameters)(Code) | | Add parameters stored in the Map to the uri string.
Map can contain Object values which will be converted to the string,
or Object arrays, which will be treated as multivalue attributes.
Parameters: uri - The uri to add parameters into Parameters: parameters - The map containing parameters to be added The uri with added parameters |
relativize | public static String relativize(String path, String absoluteResource)(Code) | | Relativize an absolute resource on a given absolute path.
Parameters: path - The absolute path Parameters: absoluteResource - The absolute resource the resource relative to the given path |
removeAuthorisation | public static String removeAuthorisation(String uri)(Code) | | Remove any authorisation details from a URI
|
|
|