|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.directory.shared.ldap.ldif.LdifUtils
public class LdifUtils
Some LDIF useful methods
| Constructor Summary | |
|---|---|
LdifUtils()
|
|
| Method Summary | |
|---|---|
static javax.naming.directory.Attributes |
convertAttributesFromLdif(java.lang.String ldif)
Convert a LDIF String to an attributes. |
static java.lang.String |
convertAttributesToLdif(Entry entry)
Convert all the Entry's attributes to LDIF. |
static java.lang.String |
convertAttributesToLdif(Entry entry,
int length)
Convert the Entry's attributes to LDIF. |
static java.lang.String |
convertEntryToLdif(Entry entry)
Convert an Entry to LDIF |
static java.lang.String |
convertEntryToLdif(Entry entry,
int length)
Convert an Entry as LDIF |
static java.lang.String |
convertToLdif(javax.naming.directory.Attributes attrs)
Convert an Attributes as LDIF |
static java.lang.String |
convertToLdif(javax.naming.directory.Attributes attrs,
DN dn)
Convert an Attributes as LDIF. |
static java.lang.String |
convertToLdif(javax.naming.directory.Attributes attrs,
DN dn,
int length)
Convert an Attributes as LDIF. |
static java.lang.String |
convertToLdif(javax.naming.directory.Attributes attrs,
int length)
Convert an Attributes as LDIF |
static java.lang.String |
convertToLdif(EntryAttribute attr)
Converts an EntryAttribute to LDIF |
static java.lang.String |
convertToLdif(EntryAttribute attr,
int length)
Converts an EntryAttribute as LDIF |
static java.lang.String |
convertToLdif(LdifEntry entry)
Convert an LdifEntry to LDIF |
static java.lang.String |
convertToLdif(LdifEntry entry,
int length)
Convert an LdifEntry to LDIF |
static javax.naming.directory.Attributes |
createAttributes(java.lang.Object... avas)
Build a new Attributes instance from a LDIF list of lines. |
static boolean |
isLDIFSafe(java.lang.String str)
Checks if the input String contains only safe values, that is, the data does not need to be encoded for use with LDIF. |
static java.lang.String |
stripLineToNChars(java.lang.String str,
int nbChars)
Strips the String every n specified characters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LdifUtils()
| Method Detail |
|---|
public static boolean isLDIFSafe(java.lang.String str)
str - the String to be checked
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs)
throws LdapException
attrs - the Attributes to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
int length)
throws LdapException
attrs - the Attributes to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
DN dn,
int length)
throws LdapException
attrs - the Attributes to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
DN dn)
throws LdapException
attrs - the Attributes to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertEntryToLdif(Entry entry)
throws LdapException
entry - the Entry to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertAttributesToLdif(Entry entry)
throws LdapException
entry - the Entry to convert
LdapException - If a naming exception is encountered.
public static javax.naming.directory.Attributes convertAttributesFromLdif(java.lang.String ldif)
throws LdapLdifException
ldif - The LDIF string containing an attribute value
LdapException - If the LDIF String cannot be converted to an Attributes
LdapLdifException
public static java.lang.String convertEntryToLdif(Entry entry,
int length)
throws LdapException
entry - the Entry to convertlength - the expected line length
LdapException - If a naming exception is encountered.
public static java.lang.String convertAttributesToLdif(Entry entry,
int length)
throws LdapException
entry - the Entry to convertlength - the expected line length
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(LdifEntry entry)
throws LdapException
entry - the LdifEntry to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(LdifEntry entry,
int length)
throws LdapException
entry - the LdifEntry to convertlength - The maximum line's length
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(EntryAttribute attr)
throws LdapException
attr - the >EntryAttribute to convert
LdapException - If a naming exception is encountered.
public static java.lang.String convertToLdif(EntryAttribute attr,
int length)
throws LdapException
attr - the EntryAttribute to convertlength - the expected line length
LdapException - If a naming exception is encountered.
public static java.lang.String stripLineToNChars(java.lang.String str,
int nbChars)
str - the string to stripnbChars - the number of characters
public static javax.naming.directory.Attributes createAttributes(java.lang.Object... avas)
throws LdapException,
LdapLdifException
Attribute attr = AttributeUtils.createAttributes(
"objectclass: top",
"cn", "My name",
"jpegPhoto", new byte[]{0x01, 0x02} );
avas - The AttributeType and Values, using a ldif format, or a couple of
Attribute ID/Value
LdapException - If the data are invalid
LdapLdifException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||