/** * Convert all the Entry's attributes to LDIF. The Dn is not written * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertAttributesToLdif( Entry entry ) { return convertAttributesToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert all the Entry's attributes to LDIF. The Dn is not written * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertAttributesToLdif( Entry entry ) { return convertAttributesToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert all the Entry's attributes to LDIF. The Dn is not written * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertAttributesToLdif( Entry entry ) { return convertAttributesToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Return the extensions formated as Ldif lines * * @param id The attributeId : can be m-objectClassExtension or * m-attributeTypeExtension * @return The extensions formated as ldif lines * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ protected String extensionsToLdif( String id ) throws LdapException { StringBuilder sb = new StringBuilder(); Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( id ); for ( String extension : extensions.keySet() ) { attribute.add( extension ); } sb.append( LdifUtils.convertAttributesToLdif( entry ) ); return sb.toString(); }
/** * Return the extensions formated as Ldif lines * * @param id The attributeId : can be m-objectClassExtension or * m-attributeTypeExtension * @return The extensions formated as ldif lines * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ protected String extensionsToLdif( String id ) throws LdapException { StringBuilder sb = new StringBuilder(); Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( id ); for ( String extension : extensions.keySet() ) { attribute.add( extension ); } sb.append( LdifUtils.convertAttributesToLdif( entry ) ); return sb.toString(); }
/** * @return the Names as Ldif lines * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ private String nameToLdif() throws LdapException { if ( names.isEmpty() ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-name" ); for ( String name : names ) { attribute.add( name ); } entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * @return the Names as Ldif lines * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ private String nameToLdif() throws LdapException { if ( names.isEmpty() ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-name" ); for ( String name : names ) { attribute.add( name ); } entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * @return The description as a ldif line * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ private String descToLdif() throws LdapException { if ( Strings.isEmpty( description ) ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-description", description ); entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * @return The description as a ldif line * @throws org.apache.directory.api.ldap.model.exception.LdapException If the conversion goes wrong */ private String descToLdif() throws LdapException { if ( Strings.isEmpty( description ) ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-description", description ); entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }