List of usage examples for org.apache.commons.httpclient URI getDefaultProtocolCharset
public static String getDefaultProtocolCharset()
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Get the all escaped and encoded string with the default protocl charset. * It's the same function to use encode(String unescaped, Bitset * empty, URI.getDefaultProtocolCharset()). * * @param unescaped an unescaped string// w w w. j a v a2 s .c o m * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodeAll(String unescaped) throws URIException { return encodeAll(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as within the authority component of * an URI with the default protocol charset. * Within the authority component, the characters ";", ":", "@", "?", and * "/" are reserved./*from www .j av a2s . c o m*/ * * @param unescaped an unescaped string * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodeWithinAuthority(String unescaped) throws URIException { return encodeWithinAuthority(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as the path and query components of * an URI with the default protocol charset. * * @param unescaped an unescaped string//from w ww .j a va 2 s .co m * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodePathQuery(String unescaped) throws URIException { return encodePathQuery(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as within the path component of an * URI with the default protocol charset. * The path may consist of a sequence of path segments separated by a * single slash "/" character. Within a path segment, the characters * "/", ";", "=", and "?" are reserved./*from ww w . j a v a2 s . c om*/ * * @param unescaped an unescaped string * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodeWithinPath(String unescaped) throws URIException { return encodeWithinPath(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as the path component of an URI with * the default protocol charset.//from w w w . j av a 2s .c om * * @param unescaped an unescaped string * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodePath(String unescaped) throws URIException { return encodePath(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as within the query component of an * URI with the default protocol charset. * When a query comprise the name and value pairs, it is used in order * to encode each name and value string. The reserved special characters * within a query component are being included in encoding the query. * * @param unescaped an unescaped string/* w w w . ja v a2 s. c om*/ * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodeWithinQuery(String unescaped) throws URIException { return encodeWithinQuery(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a string regarded as the query component of an URI with * the default protocol charset./* w ww . j av a 2 s .com*/ * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, this method * is recommended to use in encoding the whole query. * * @param unescaped an unescaped string * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see #encode */ public static String encodeQuery(String unescaped) throws URIException { return encodeQuery(unescaped, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Escape and encode a given string with allowed characters not to be * escaped and the default protocol charset. * * @param unescaped a string//from w w w .ja va 2s . c o m * @param allowed allowed characters not to be escaped * @return the escaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see Coder#encode */ public static String encode(String unescaped, BitSet allowed) throws URIException { return encode(unescaped, allowed, URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Unescape and decode a given string regarded as an escaped string with the * default protocol charset.//from w ww. j av a 2 s . c o m * * @param escaped a string * @return the unescaped string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * @see Coder#decode */ public static String decode(String escaped) throws URIException { return Coder.decode(escaped.toCharArray(), URI.getDefaultProtocolCharset()); }
From source file:be.jcdo.mp3searchengines.tools.URIUtils.java
/** * Convert a target string to the specified character encoded string with * the default protocol charset./*from w w w.j a va2 s. c o m*/ * * @param target a target string * @return the protocol character encoded string * * @throws URIException if the default protocol charset is not supported * * @see URI#getDefaultProtocolCharset * * @deprecated Do not use. To be removed */ public static String toProtocolCharset(String target) throws URIException { return toUsingCharset(target, URI.getDefaultDocumentCharset(), URI.getDefaultProtocolCharset()); }