/** * Escape and encode a given string with allowed characters not to be * escaped. * * @param unescapedComponent an unescaped component * @param allowed allowed characters not to be escaped * @param charset the charset to encode * @return the escaped and encoded string * * @throws URIException if the charset is not supported * * @deprecated use org.apache.commons.codec.net.URLCodec */ public static char[] encode(String unescapedComponent, BitSet allowed, String charset) throws URIException { return URI.encode(unescapedComponent, allowed, charset); }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
_path = encode(path, allowed_abs_path, charset); } else if (_is_rel_path) { StringBuffer buff = new StringBuffer(path.length()); buff.append(encode(path.substring(0, at), allowed_rel_path, charset)); buff.append(encode(path.substring(at), allowed_abs_path, charset)); } else { buff.append(encode(path, allowed_rel_path, charset)); buf.insert(0, encode(path.substring(0, 1), uric_no_slash, charset)); buf.insert(1, encode(path.substring(1), uric, charset)); _opaque = buf.toString().toCharArray(); } else {
/** * Set the query. * <p> * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, it is * recommended to use in encoding the whole query with this method. * <p> * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from <code>URI</code>. So refer to the same-named APIs * implemented in each specific protocol instance. * * @param query the query string. * @throws URIException incomplete trailing escape pattern or unsupported * character encoding * @see #encode */ public void setQuery(String query) throws URIException { if (query == null || query.length() == 0) { _query = (query == null) ? null : query.toCharArray(); setURI(); return; } setRawQuery(encode(query, allowed_query, getProtocolCharset())); }
throw new URIException(URIException.PARSING, "incorrect scheme"); _opaque = encode(schemeSpecificPart, allowed_opaque_part, getProtocolCharset());
/** * Escape and encode a given string with allowed characters not to be * escaped. * * @param unescapedComponent an unescaped component * @param allowed allowed characters not to be escaped * @param charset the charset to encode * @return the escaped and encoded string * * @throws URIException if the charset is not supported * * @deprecated use org.apache.commons.codec.net.URLCodec */ public static char[] encode(String unescapedComponent, BitSet allowed, String charset) throws URIException { return URI.encode(unescapedComponent, allowed, charset); }
/** * Escape and encode a given string with allowed characters not to be * escaped. * * @param unescapedComponent an unescaped component * @param allowed allowed characters not to be escaped * @param charset the charset to encode * @return the escaped and encoded string * * @throws URIException if the charset is not supported * * @deprecated use org.apache.commons.codec.net.URLCodec */ public static char[] encode(String unescapedComponent, BitSet allowed, String charset) throws URIException { return URI.encode(unescapedComponent, allowed, charset); }
/** * Escape and encode a given string with allowed characters not to be * escaped. * * @param unescapedComponent an unescaped component * @param allowed allowed characters not to be escaped * @param charset the charset to encode * @return the escaped and encoded string * * @throws URIException if the charset is not supported * * @deprecated use org.apache.commons.codec.net.URLCodec */ public static char[] encode(String unescapedComponent, BitSet allowed, String charset) throws URIException { return URI.encode(unescapedComponent, allowed, charset); }
/** * Escape and encode a given string with allowed characters not to be * escaped. * * @param unescapedComponent an unescaped component * @param allowed allowed characters not to be escaped * @param charset the charset to encode * @return the escaped and encoded string * * @throws URIException if the charset is not supported * * @deprecated use org.apache.commons.codec.net.URLCodec */ public static char[] encode(String unescapedComponent, BitSet allowed, String charset) throws URIException { return URI.encode(unescapedComponent, allowed, charset); }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
/** * Set the fragment. * * @param fragment the fragment string. * @throws URIException If an error occurs. */ public void setFragment(String fragment) throws URIException { if (fragment == null || fragment.length() == 0) { _fragment = (fragment == null) ? null : fragment.toCharArray(); hash = 0; return; } _fragment = encode(fragment, allowed_fragment, getProtocolCharset()); hash = 0; }
/** * Set the query. * <p> * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, it is * recommended to use in encoding the whole query with this method. * <p> * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from <code>URI</code>. So refer to the same-named APIs * implemented in each specific protocol instance. * * @param query the query string. * @throws URIException incomplete trailing escape pattern or unsupported * character encoding * @see #encode */ public void setQuery(String query) throws URIException { if (query == null || query.length() == 0) { _query = (query == null) ? null : query.toCharArray(); setURI(); return; } setRawQuery(encode(query, allowed_query, getProtocolCharset())); }
/** * Set the query. * <p> * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, it is * recommended to use in encoding the whole query with this method. * <p> * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from <code>URI</code>. So refer to the same-named APIs * implemented in each specific protocol instance. * * @param query the query string. * @throws URIException incomplete trailing escape pattern or unsupported * character encoding * @see #encode */ public void setQuery(String query) throws URIException { if (query == null || query.length() == 0) { _query = (query == null) ? null : query.toCharArray(); setURI(); return; } setRawQuery(encode(query, allowed_query, getProtocolCharset())); }
/** * Set the query. * <p> * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, it is * recommended to use in encoding the whole query with this method. * <p> * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from <code>URI</code>. So refer to the same-named APIs * implemented in each specific protocol instance. * * @param query the query string. * @throws URIException incomplete trailing escape pattern or unsupported * character encoding * @see #encode */ public void setQuery(String query) throws URIException { if (query == null || query.length() == 0) { _query = (query == null) ? null : query.toCharArray(); setURI(); return; } setRawQuery(encode(query, allowed_query, getProtocolCharset())); }
/** * Set the query. * <p> * When a query string is not misunderstood the reserved special characters * ("&", "=", "+", ",", and "$") within a query component, it is * recommended to use in encoding the whole query with this method. * <p> * The additional APIs for the special purpose using by the reserved * special characters used in each protocol are implemented in each protocol * classes inherited from <code>URI</code>. So refer to the same-named APIs * implemented in each specific protocol instance. * * @param query the query string. * @throws URIException incomplete trailing escape pattern or unsupported * character encoding * @see #encode */ public void setQuery(String query) throws URIException { if (query == null || query.length() == 0) { _query = (query == null) ? null : query.toCharArray(); setURI(); return; } setRawQuery(encode(query, allowed_query, getProtocolCharset())); }