|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ca.commons.naming.LdifUtility
collection of static utility ftns. for writing and reading ldif files. Currently does not handle URLs properly, but will do base64 encoding quite happily given half a chance...
| Constructor Summary | |
LdifUtility()
|
|
LdifUtility(java.util.Hashtable params,
java.lang.String filedir)
Constructor |
|
| Method Summary | |
java.lang.Object |
expandValueParams(java.lang.Object value)
This method expands the strings inside the ldif file that match the list of expandable strings in params list. |
void |
ldifDecode(java.lang.String parseableLine,
DXEntry newEntry)
Parse an attribute: value line of an ldif file, and place the attribute value pair in an Attributes object. |
java.lang.String |
ldifEncode(java.lang.Object o,
int offset)
This is used to write a value that is *probably* normal string encoded, but *may* need to be base64 encoded. |
java.lang.String |
ldifEncode(java.lang.Object o,
int offset,
boolean forceBase64Encoding)
This is used to write a value that is *probably* normal string encoded, but *may* need to be base64 encoded. |
DXEntry |
readLdifEntry(java.io.BufferedReader textReader)
Reads an entry of ldif text (i.e. att/val pairs until a blank line) |
void |
setFileDir(java.lang.String filedir)
Set the ldif filepath - used to find input files |
void |
setParams(java.util.Hashtable params)
Set the ldif file parameters |
void |
writeLdifEntry(java.lang.String dn,
java.io.FileWriter saveFile,
java.lang.String originalPrefix,
java.lang.String replacementPrefix,
javax.naming.directory.Attributes atts)
retrieves a single entry from the directory and writes it out to an ldif file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LdifUtility()
public LdifUtility(java.util.Hashtable params,
java.lang.String filedir)
params - - hashtable with the list of string that will have to be suvstituted in the ldif filefiledir - - ldif file directory, used to find the input files specified in the ldif stream| Method Detail |
public void setFileDir(java.lang.String filedir)
filedir - file pathpublic void setParams(java.util.Hashtable params)
params - list of parameters
public java.lang.String ldifEncode(java.lang.Object o,
int offset,
boolean forceBase64Encoding)
o - the object to be ldif encoded
public java.lang.String ldifEncode(java.lang.Object o,
int offset)
o - the object to be ldif encoded
public void writeLdifEntry(java.lang.String dn,
java.io.FileWriter saveFile,
java.lang.String originalPrefix,
java.lang.String replacementPrefix,
javax.naming.directory.Attributes atts)
throws javax.naming.NamingException,
java.io.IOException
dn - the ldap escaped dn of the entry being writtensaveFile - the file to write the entry tooriginalPrefix - an optional portion of the dn to updatereplacementPrefix - an optional replacement for a portion of the dnatts - the attributes of teh entry
javax.naming.NamingException
java.io.IOException
public void ldifDecode(java.lang.String parseableLine,
DXEntry newEntry)
parseableLine - a complete ldif text line (unwrapped) to parsenewEntry - the partially created entry, which is modified by this
method.
public DXEntry readLdifEntry(java.io.BufferedReader textReader)
throws java.io.IOException
java.io.InterruptedIOException - if the user hits cancel on the progress bar
java.io.IOExceptionpublic java.lang.Object expandValueParams(java.lang.Object value)
value - value to be expanded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||