/** * Set the query as the name and value pair. * * @param queryName the query string. * @param queryValue the query string. * @throws URIException incomplete trailing escape pattern * Or unsupported character encoding * @throws NullPointerException null query * @see #encode */ public void setQuery(String queryName, String queryValue) throws URIException, NullPointerException { StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); buff.append(encode(queryName, allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue, allowed_within_query, charset)); _query = buff.toString().toCharArray(); setURI(); }
/** * Set the query as the name and value pairs. * * @param queryName the array of the query string. * @param queryValue the array of the query string. * @throws URIException incomplete trailing escape pattern, * unsupported character encoding or wrong array size * @throws NullPointerException null query * @see #encode */ public void setQuery(String[] queryName, String[] queryValue) throws URIException, NullPointerException { int length = queryName.length; if (length != queryValue.length) { throw new URIException("wrong array size of query"); } StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); for (int i = 0; i < length; i++) { buff.append(encode(queryName[i], allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue[i], allowed_within_query, charset)); if (i + 1 < length) { buff.append('&'); } } _query = buff.toString().toCharArray(); setURI(); }
/** * Set the raw-escaped user. * * @param escapedUser the raw-escaped user * @throws URIException escaped user not valid or user required */ public void setRawUser(char[] escapedUser) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped user not valid"); } String username = new String(escapedUser); char[] rawPassword = getRawPassword(); String password = rawPassword == null ? null : new String(rawPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user and password. * * @param escapedUser the raw-escaped user * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped user not valid or user required; escaped * password not valid or username missed */ public void setRawUserinfo(char[] escapedUser, char[] escapedPassword) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo) || ((escapedPassword != null) && !validate(escapedPassword, within_userinfo))) { throw new URIException(URIException.ESCAPING, "escaped userinfo not valid"); } String username = new String(escapedUser); String password = (escapedPassword == null) ? null : new String(escapedPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped password. * * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped password not valid or username missed */ public void setRawPassword(char[] escapedPassword) throws URIException { if (escapedPassword != null && !validate(escapedPassword, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped password not valid"); } if (getRawUser() == null || getRawUser().length == 0) { throw new URIException(URIException.PARSING, "username required"); } String username = new String(getRawUser()); String password = escapedPassword == null ? null : new String(escapedPassword); // an emtpy string is allowed as a password String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the query as the name and value pair. * * @param queryName the query string. * @param queryValue the query string. * @throws URIException incomplete trailing escape pattern * Or unsupported character encoding * @throws NullPointerException null query * @see #encode */ public void setQuery(String queryName, String queryValue) throws URIException, NullPointerException { StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); buff.append(encode(queryName, allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue, allowed_within_query, charset)); _query = buff.toString().toCharArray(); setURI(); }
/** * Set the query as the name and value pair. * * @param queryName the query string. * @param queryValue the query string. * @throws URIException incomplete trailing escape pattern * Or unsupported character encoding * @throws NullPointerException null query * @see #encode */ public void setQuery(String queryName, String queryValue) throws URIException, NullPointerException { StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); buff.append(encode(queryName, allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue, allowed_within_query, charset)); _query = buff.toString().toCharArray(); setURI(); }
/** * Set the query as the name and value pair. * * @param queryName the query string. * @param queryValue the query string. * @throws URIException incomplete trailing escape pattern * Or unsupported character encoding * @throws NullPointerException null query * @see #encode */ public void setQuery(String queryName, String queryValue) throws URIException, NullPointerException { StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); buff.append(encode(queryName, allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue, allowed_within_query, charset)); _query = buff.toString().toCharArray(); setURI(); }
/** * Set the query as the name and value pair. * * @param queryName the query string. * @param queryValue the query string. * @throws URIException incomplete trailing escape pattern * Or unsupported character encoding * @throws NullPointerException null query * @see #encode */ public void setQuery(String queryName, String queryValue) throws URIException, NullPointerException { StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); buff.append(encode(queryName, allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue, allowed_within_query, charset)); _query = buff.toString().toCharArray(); setURI(); }
/** * Set the query as the name and value pairs. * * @param queryName the array of the query string. * @param queryValue the array of the query string. * @throws URIException incomplete trailing escape pattern, * unsupported character encoding or wrong array size * @throws NullPointerException null query * @see #encode */ public void setQuery(String[] queryName, String[] queryValue) throws URIException, NullPointerException { int length = queryName.length; if (length != queryValue.length) { throw new URIException("wrong array size of query"); } StringBuffer buff = new StringBuffer(); // set the charset to do escape encoding String charset = getProtocolCharset(); for (int i = 0; i < length; i++) { buff.append(encode(queryName[i], allowed_within_query, charset)); buff.append('='); buff.append(encode(queryValue[i], allowed_within_query, charset)); if (i + 1 < length) { buff.append('&'); } } _query = buff.toString().toCharArray(); setURI(); }
/** * Set the raw-escaped user. * * @param escapedUser the raw-escaped user * @throws URIException escaped user not valid or user required */ public void setRawUser(char[] escapedUser) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped user not valid"); } String username = new String(escapedUser); char[] rawPassword = getRawPassword(); String password = rawPassword == null ? null : new String(rawPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user. * * @param escapedUser the raw-escaped user * @throws URIException escaped user not valid or user required */ public void setRawUser(char[] escapedUser) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped user not valid"); } String username = new String(escapedUser); char[] rawPassword = getRawPassword(); String password = rawPassword == null ? null : new String(rawPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user. * * @param escapedUser the raw-escaped user * @throws URIException escaped user not valid or user required */ public void setRawUser(char[] escapedUser) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped user not valid"); } String username = new String(escapedUser); char[] rawPassword = getRawPassword(); String password = rawPassword == null ? null : new String(rawPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user. * * @param escapedUser the raw-escaped user * @throws URIException escaped user not valid or user required */ public void setRawUser(char[] escapedUser) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped user not valid"); } String username = new String(escapedUser); char[] rawPassword = getRawPassword(); String password = rawPassword == null ? null : new String(rawPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user and password. * * @param escapedUser the raw-escaped user * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped user not valid or user required; escaped * password not valid or username missed */ public void setRawUserinfo(char[] escapedUser, char[] escapedPassword) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo) || ((escapedPassword != null) && !validate(escapedPassword, within_userinfo))) { throw new URIException(URIException.ESCAPING, "escaped userinfo not valid"); } String username = new String(escapedUser); String password = (escapedPassword == null) ? null : new String(escapedPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped user and password. * * @param escapedUser the raw-escaped user * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped user not valid or user required; escaped * password not valid or username missed */ public void setRawUserinfo(char[] escapedUser, char[] escapedPassword) throws URIException { if (escapedUser == null || escapedUser.length == 0) { throw new URIException(URIException.PARSING, "user required"); } if (!validate(escapedUser, within_userinfo) || ((escapedPassword != null) && !validate(escapedPassword, within_userinfo))) { throw new URIException(URIException.ESCAPING, "escaped userinfo not valid"); } String username = new String(escapedUser); String password = (escapedPassword == null) ? null : new String(escapedPassword); String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped password. * * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped password not valid or username missed */ public void setRawPassword(char[] escapedPassword) throws URIException { if (escapedPassword != null && !validate(escapedPassword, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped password not valid"); } if (getRawUser() == null || getRawUser().length == 0) { throw new URIException(URIException.PARSING, "username required"); } String username = new String(getRawUser()); String password = escapedPassword == null ? null : new String(escapedPassword); // an emtpy string is allowed as a password String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped password. * * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped password not valid or username missed */ public void setRawPassword(char[] escapedPassword) throws URIException { if (escapedPassword != null && !validate(escapedPassword, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped password not valid"); } if (getRawUser() == null || getRawUser().length == 0) { throw new URIException(URIException.PARSING, "username required"); } String username = new String(getRawUser()); String password = escapedPassword == null ? null : new String(escapedPassword); // an emtpy string is allowed as a password String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped password. * * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped password not valid or username missed */ public void setRawPassword(char[] escapedPassword) throws URIException { if (escapedPassword != null && !validate(escapedPassword, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped password not valid"); } if (getRawUser() == null || getRawUser().length == 0) { throw new URIException(URIException.PARSING, "username required"); } String username = new String(getRawUser()); String password = escapedPassword == null ? null : new String(escapedPassword); // an emtpy string is allowed as a password String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }
/** * Set the raw-escaped password. * * @param escapedPassword the raw-escaped password; could be null * @throws URIException escaped password not valid or username missed */ public void setRawPassword(char[] escapedPassword) throws URIException { if (escapedPassword != null && !validate(escapedPassword, within_userinfo)) { throw new URIException(URIException.ESCAPING, "escaped password not valid"); } if (getRawUser() == null || getRawUser().length == 0) { throw new URIException(URIException.PARSING, "username required"); } String username = new String(getRawUser()); String password = escapedPassword == null ? null : new String(escapedPassword); // an emtpy string is allowed as a password String userinfo = username + ((password == null) ? "" : ":" + password); String hostname = new String(getRawHost()); String hostport = (_port == -1) ? hostname : hostname + ":" + _port; String authority = userinfo + "@" + hostport; _userinfo = userinfo.toCharArray(); _authority = authority.toCharArray(); setURI(); }