/** * Encodes the characters of string that are either non-ASCII characters * or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @return the encoded string. */ public static String encode(String s, Type t) { return _encode(s, t, false, false); }
/** * Contextually encodes the characters of string that are either non-ASCII * characters or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. Percent-encoded characters will be recognized and not * double encoded. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @return the encoded string. */ public static String contextualEncode(String s, Type t) { return _encode(s, t, false, true); }
/** * Encodes the characters of string that are either non-ASCII characters * or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @param template true if the encoded string contains URI template variables * @return the encoded string. */ public static String encode(String s, Type t, boolean template) { return _encode(s, t, template, false); }
/** * Encodes the characters of string that are either non-ASCII characters * or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @param template true if the encoded string contains URI template variables * @return the encoded string. */ public static String encode(String s, Type t, boolean template) { return _encode(s, t, template, false); }
/** * Encodes the characters of string that are either non-ASCII characters * or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @return the encoded string. */ public static String encode(String s, Type t) { return _encode(s, t, false, false); }
/** * Contextually encodes the characters of string that are either non-ASCII * characters or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. Percent-encoded characters will be recognized and not * double encoded. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @param template true if the encoded string contains URI template variables * @return the encoded string. */ public static String contextualEncode(String s, Type t, boolean template) { return _encode(s, t, template, true); }
/** * Contextually encodes the characters of string that are either non-ASCII * characters or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. Percent-encoded characters will be recognized and not * double encoded. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @return the encoded string. */ public static String contextualEncode(String s, Type t) { return _encode(s, t, false, true); }
/** * Contextually encodes the characters of string that are either non-ASCII * characters or are ASCII characters that must be percent-encoded using the * UTF-8 encoding. Percent-encoded characters will be recognized and not * double encoded. * * @param s the string to be encoded. * @param t the URI component type identifying the ASCII characters that * must be percent-encoded. * @param template true if the encoded string contains URI template variables * @return the encoded string. */ public static String contextualEncode(String s, Type t, boolean template) { return _encode(s, t, template, true); }