public static String entryToLDIF ( final ChaiEntry theEntry ) throws ChaiUnavailableException , ChaiOperationException { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "dn: " ) . append ( theEntry . getEntryDN ( ) ) . append ( "\n" ) ; final Map < String , Map < String , List < String > > > results = theEntry . getChaiProvider ( ) . searchMultiValues ( theEntry . getEntryDN ( ) , "(objectClass=*)" , null , SearchScope . BASE ) ; final Map < String , List < String > > props = results . get ( theEntry . getEntryDN ( ) ) ; for ( final Map . Entry < String , List < String > > entry : props . entrySet ( ) ) { final String attrName = entry . getKey ( ) ; final List < String > values = entry . getValue ( ) ; for ( final String value : values ) { sb . append ( attrName ) . append ( ": " ) . append ( value ) . append ( ' ' ) ; } } return sb . toString ( ) ; }
Convert to an LDIF format . Useful for debugging or other purposes