/** * Returns the RDN after escaping the characters requiring escaping. * * @see <a href="../../../../api/com/novell/ldap/LDAPDN.html#escapeRDN(java.lang.String)"> com.novell.ldap.LDAPDN.escapeRDN(String)</a> */ public static String escapeRDN (String rdn) { return com.novell.ldap.LDAPDN.escapeRDN(rdn); }
/** * Fully escape DN value (the part after the =). * <p> * For example, for the dn value "Acme, Inc", the escapeLDAPDNValue method returns "Acme\, Inc". * </p> * * @param value the DN value to escape * @return the escaped version o the DN value */ public static String escapeLDAPDNValue(String value) { return LDAPDN.escapeRDN("key=" + value).substring(4); }
/** * Fully escape DN value (the part after the =). * <p> * For example, for the dn value "Acme, Inc", the escapeLDAPDNValue method returns "Acme\, Inc". * </p> * * @param value the DN value to escape * @return the escaped version o the DN value */ public static String escapeLDAPDNValue(String value) { return StringUtils.isBlank(value) ? value : LDAPDN.escapeRDN("key=" + value).substring(4); }
/** * Creates and returns a string that represents this DN. The string * follows RFC 2253, which describes String representation of DN's and * RDN's * * @return A DN string. */ public String toString() { int length=rdnList.size(); String dn = ""; if (length < 1) return null; dn = LDAPDN.escapeRDN(rdnList.get(0).toString()); for (int i=1; i<length; i++) dn += "," + LDAPDN.escapeRDN(rdnList.get(i).toString()); return dn; }