use of org.apache.directory.api.ldap.model.exception.LdapUriException in project directory-ldap-api by apache.
the class LdapUrl method parseDN.
/**
* Parse a string and check that it complies with RFC 2253. Here, we will
* just call the Dn parser to do the job.
*
* @param chars The char array to be checked
* @param pos the starting position
* @return -1 if the char array does not contains a Dn
*/
private int parseDN(char[] chars, int pos) {
int end = pos;
for (int i = pos; (i < chars.length) && (chars[i] != '?'); i++) {
end++;
}
try {
String dnStr = new String(chars, pos, end - pos);
dn = new Dn(decode(dnStr));
} catch (LdapUriException | LdapInvalidDnException e) {
return -1;
}
return end;
}
Aggregations