|
||||||||||
| 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 |
convertToLdif(javax.naming.directory.Attributes attrs)
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(javax.naming.directory.Attributes attrs,
LdapDN dn)
Convert an Attributes as LDIF |
static java.lang.String |
convertToLdif(javax.naming.directory.Attributes attrs,
LdapDN dn,
int length)
Convert an Attributes as LDIF |
static java.lang.String |
convertToLdif(Entry attrs)
Convert an Entry 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(Entry entry,
int length)
Convert an Entry as LDIF |
static java.lang.String |
convertToLdif(LdifEntry entry)
Convert an Entry to LDIF |
static java.lang.String |
convertToLdif(LdifEntry entry,
int length)
Convert an Entry to LDIF |
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 LdifEntry |
reverseAdd(LdapDN dn)
Compute a reverse LDIF of an AddRequest. |
static LdifEntry |
reverseDel(LdapDN dn,
Entry deletedEntry)
Compute a reverse LDIF of a DeleteRequest. |
static LdifEntry |
reverseModify(LdapDN dn,
java.util.List<Modification> forwardModifications,
Entry modifiedEntry)
Compute the reversed LDIF for a modify request. |
static LdifEntry |
reverseModifyDn(LdapDN newSuperiorDn,
LdapDN modifiedDn)
Compute a reverse LDIF for a forward change which if in LDIF format would represent a moddn operation. |
static java.util.List<LdifEntry> |
reverseModifyRdn(javax.naming.directory.Attributes t0,
LdapDN t1_parentDn,
LdapDN t0_dn,
Rdn t1_rdn)
Compute a reverse LDIF for a forward change which if in LDIF format would represent a modrdn operation. |
static java.util.List<LdifEntry> |
reverseRename(javax.naming.directory.Attributes t0,
LdapDN t0_dn,
Rdn t1_rdn)
Revert a DN to it's previous version by removing the first RDN and adding the given RDN |
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 javax.naming.NamingException
attrs - the Attributes to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
int length)
throws javax.naming.NamingException
attrs - the Attributes to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
LdapDN dn,
int length)
throws javax.naming.NamingException
attrs - the Attributes to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(javax.naming.directory.Attributes attrs,
LdapDN dn)
throws javax.naming.NamingException
attrs - the Attributes to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(Entry attrs)
throws javax.naming.NamingException
attrs - the Entry to convert
javax.naming.NamingException - If a naming exception is encountered.
public static javax.naming.directory.Attributes convertAttributesFromLdif(java.lang.String ldif)
throws javax.naming.NamingException
ldif - The LDIF string containing an attribute value
javax.naming.NamingException - If the LDIF String cannot be converted to an Attributes
public static java.lang.String convertToLdif(Entry entry,
int length)
throws javax.naming.NamingException
entry - the Entry to convertlength - the expected line length
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(LdifEntry entry)
throws javax.naming.NamingException
entry - the entry to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(LdifEntry entry,
int length)
throws javax.naming.NamingException
entry - the entry to convertlength - The maximum line's length
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(EntryAttribute attr)
throws javax.naming.NamingException
attr - the >EntryAttribute to convert
javax.naming.NamingException - If a naming exception is encountered.
public static java.lang.String convertToLdif(EntryAttribute attr,
int length)
throws javax.naming.NamingException
attr - the EntryAttribute to convertlength - the expected line length
javax.naming.NamingException - 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 LdifEntry reverseAdd(LdapDN dn)
dn - the dn of the added entry
public static LdifEntry reverseDel(LdapDN dn,
Entry deletedEntry)
throws javax.naming.NamingException
dn - The deleted entry DNdeletedEntry - The entry which has been deleted
javax.naming.NamingException
public static LdifEntry reverseModifyDn(LdapDN newSuperiorDn,
LdapDN modifiedDn)
throws javax.naming.NamingException
newSuperiorDn - the new parent dn to be (must not be null)modifiedDn - the dn of the entry being moved (must not be null)
javax.naming.NamingException - if something went wrong
public static java.util.List<LdifEntry> reverseRename(javax.naming.directory.Attributes t0,
LdapDN t0_dn,
Rdn t1_rdn)
throws javax.naming.NamingException
t0 - The initial Attributest0_dn - The initial DNt1_rdn - The new RDN
javax.naming.NamingException - If the name reverting failed
public static java.util.List<LdifEntry> reverseModifyRdn(javax.naming.directory.Attributes t0,
LdapDN t1_parentDn,
LdapDN t0_dn,
Rdn t1_rdn)
throws javax.naming.NamingException
t0 - the entry the way it was before changes were madet1_parentDn - the new superior dn if this is a move, otherwise nullt0_dn - the dn of the entry being modifiedt1_rdn - the new rdn to use
javax.naming.NamingException - If something went wrong
public static LdifEntry reverseModify(LdapDN dn,
java.util.List<Modification> forwardModifications,
Entry modifiedEntry)
throws javax.naming.NamingException
dn - the dn of the modified entryforwardModifications - the modification items for the forward changemodifiedEntry - The modified entry. Necessary for the destructive modifications
javax.naming.NamingException - If something went wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||