1 17 package org.apache.ldap.server.prefs; 18 19 20 import org.apache.ldap.common.name.LdapName; 21 22 import javax.naming.Name ; 23 import javax.naming.NamingException ; 24 25 26 32 public class PreferencesUtils 33 { 34 35 static final String SYSPREF_BASE = "prefNodeName=sysPrefRoot,ou=system"; 36 37 38 46 public static Name toSysDn( String absPrefPath ) throws NamingException 47 { 48 LdapName dn = new LdapName( SYSPREF_BASE ); 49 50 String [] comps = absPrefPath.split( "/" ); 51 52 for ( int ii = 0; ii < comps.length; ii++ ) 53 { 54 if ( comps[ii] != null && ! comps[ii].trim().equals( "" ) ) 55 { 56 dn.add( "prefNodeName=" + comps[ii] ); 57 } 58 } 59 60 return dn; 61 } 62 } 63 | Popular Tags |