List of usage examples for javax.naming.ldap LdapName getSuffix
public Name getSuffix(int posn)
From source file:LdapNameSuffixPrefix.java
public static void main(String args[]) { String name = "cn=Mango, ou=Fruits, o=Food"; try {// w w w. j a va 2s . c o m LdapName dn = new LdapName(name); Name suffix = dn.getSuffix(1); // 1 <= index < cn.size() Name prefix = dn.getPrefix(1); // 0 <= index < 1 System.out.println(suffix); System.out.println(prefix); } catch (InvalidNameException e) { System.out.println("Cannot parse name: " + name); } }