/** * Builds a complete LDAP path, ldap and url encoded. Separates only with * ",". * * @return the LDAP path, for use in an url. */ public String toUrl() { StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE); for (int i = names.size() - 1; i >= 0; i--) { LdapRdn n = (LdapRdn) names.get(i); buffer.append(n.encodeUrl()); if (i > 0) { buffer.append(","); } } return buffer.toString(); }
/** * Builds a complete LDAP path, ldap and url encoded. Separates only with * ",". * * @return the LDAP path, for use in an url. */ public String toUrl() { StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE); for (int i = names.size() - 1; i >= 0; i--) { LdapRdn n = (LdapRdn) names.get(i); buffer.append(n.encodeUrl()); if (i > 0) { buffer.append(","); } } return buffer.toString(); }
/** * Builds a complete LDAP path, ldap and url encoded. Separates only with * ",". * * @return the LDAP path, for use in an url. */ public String toUrl() { StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE); for (int i = names.size() - 1; i >= 0; i--) { LdapRdn n = (LdapRdn) names.get(i); buffer.append(n.encodeUrl()); if (i > 0) { buffer.append(","); } } return buffer.toString(); }
/** * Builds a complete LDAP path, ldap and url encoded. Separates only with * ",". * * @return the LDAP path, for use in an url. */ public String toUrl() { StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE); for (int i = names.size() - 1; i >= 0; i--) { LdapRdn n = (LdapRdn) names.get(i); buffer.append(n.encodeUrl()); if (i > 0) { buffer.append(","); } } return buffer.toString(); }
@Test public void testEncodeUrl_SpacesInValue() { LdapRdn rdn = new LdapRdn("o = my organization "); assertThat(rdn.encodeUrl()).isEqualTo("o=my%20organization"); }
@Test public void testEncodeUrl() { LdapRdn rdn = new LdapRdn("o = example.com "); assertThat(rdn.encodeUrl()).isEqualTo("o=example.com"); }