@Test public void getOu() { assertEquals("", LdapUtils.getOu()); assertEquals("", LdapUtils.getOu(new String[0])); assertEquals("ou=users", LdapUtils.getOu("ou=users")); assertEquals("ou=users", LdapUtils.getOu("users")); assertEquals("ou=users,ou=pf", LdapUtils.getOu("ou=users,ou=pf")); assertEquals("ou=users,ou=pf", LdapUtils.getOu("users", "pf")); assertEquals("ou=users,ou=pf", LdapUtils.getOu("ou=users", "pf")); assertEquals("ou=users,ou=pf", LdapUtils.getOu("ou=users", "ou=pf")); assertEquals("ou=users,ou=pf", LdapUtils.getOu("users", "ou=pf")); assertEquals("", LdapUtils.getOu(null, null)); assertEquals("", LdapUtils.getOu(null, new String[] {})); assertEquals("ou=pf", LdapUtils.getOu(null, new String[] { "ou=pf" })); assertEquals("ou=pf,ou=pf-users", LdapUtils.getOu(null, new String[] { "ou=pf", "pf-users" })); assertEquals("ou=deactivated,ou=pf,ou=pf-users", LdapUtils.getOu("ou=deactivated", new String[] { "ou=pf", "pf-users" })); }
public static String getOu(final String... organizationalUnits) { if (organizationalUnits == null) { return ""; } if (organizationalUnits.length == 1 && organizationalUnits[0] != null && organizationalUnits[0].startsWith("ou=")) { return organizationalUnits[0]; } final StringBuffer buf = new StringBuffer(); buildOu(buf, null, organizationalUnits); return buf.toString(); }
LdapUtils { public static String getOu(final String... organizationalUnits) { if (organizationalUnits == null) { return ""; } if (organizationalUnits.length == 1 && organizationalUnits[0] != null && organizationalUnits[0].startsWith("ou=")) { return organizationalUnits[0]; } final StringBuffer buf = new StringBuffer(); buildOu(buf, null, organizationalUnits); return buf.toString(); } }
LdapUtils { public static String getOu(final String... organizationalUnits) { if (organizationalUnits == null) { return ""; } if (organizationalUnits.length == 1 && organizationalUnits[0] != null && organizationalUnits[0].startsWith("ou=")) { return organizationalUnits[0]; } final StringBuffer buf = new StringBuffer(); buildOu(buf, null, organizationalUnits); return buf.toString(); }  }
LdapUtils { public static String getOu(final String... organizationalUnits) { if (organizationalUnits == null) { return ""; } if (organizationalUnits.length == 1 && organizationalUnits[0] != null && organizationalUnits[0].startsWith("ou=")) { return organizationalUnits[0]; } final StringBuffer buf = new StringBuffer(); buildOu(buf, null, organizationalUnits); return buf.toString(); }  static String escapeCommonName(final String name); static String getOu(final String... organizationalUnits); static String getOu(final String ou, final String[] organizationalUnits); static void buildOu(final StringBuffer buf, final String ou, final String[] organizationalUnits); static void buildOu(final StringBuffer buf, final String... organizationalUnits); static void appendOu(final StringBuffer buf, final String... organizationalUnits); static String getOrganizationalUnit(final String dn); static String getOrganizationalUnit(final String dn, final String ouBase); static Object getAttributeValue(final Attributes attributes, final String attrId); static String getAttributeStringValue(final Attributes attributes, final String attrId); static String[] getAttributeStringValues(final Attributes attributes, final String attrId); static Integer getAttributeIntegerValue(final Attributes attributes, final String attrId); static Attribute putAttribute(final Attributes attributes, final String attrId, final String attrValue); static String splitMultipleAttribute(final String attrId, final String value); static List<String> getMissedObjectClasses(final String[] expectedAdditionalObjectClasses, final String expectedObjectClass,
      final String[] objectClasses); }
LdapUtils { public static String getOu(final String... organizationalUnits) { if (organizationalUnits == null) { return ""; } if (organizationalUnits.length == 1 && organizationalUnits[0] != null && organizationalUnits[0].startsWith("ou=")) { return organizationalUnits[0]; } final StringBuffer buf = new StringBuffer(); buildOu(buf, null, organizationalUnits); return buf.toString(); }  static String escapeCommonName(final String name); static String getOu(final String... organizationalUnits); static String getOu(final String ou, final String[] organizationalUnits); static void buildOu(final StringBuffer buf, final String ou, final String[] organizationalUnits); static void buildOu(final StringBuffer buf, final String... organizationalUnits); static void appendOu(final StringBuffer buf, final String... organizationalUnits); static String getOrganizationalUnit(final String dn); static String getOrganizationalUnit(final String dn, final String ouBase); static Object getAttributeValue(final Attributes attributes, final String attrId); static String getAttributeStringValue(final Attributes attributes, final String attrId); static String[] getAttributeStringValues(final Attributes attributes, final String attrId); static Integer getAttributeIntegerValue(final Attributes attributes, final String attrId); static Attribute putAttribute(final Attributes attributes, final String attrId, final String attrValue); static String splitMultipleAttribute(final String attrId, final String value); static List<String> getMissedObjectClasses(final String[] expectedAdditionalObjectClasses, final String expectedObjectClass,
      final String[] objectClasses);  }