use of com.unboundid.ldif.LDIFReader in project oxCore by GluuFederation.
the class LdifDataUtility method importLdifFileContent.
/**
* Performs ldif file conent import
*
* @param connection
* Connection to LDAP server
* @param ldifFileContent
* LDIF file
* @return The result code for the processing that was performed
*/
public ResultCode importLdifFileContent(LDAPConnection connection, String ldifFileContent) {
BufferedReader is = null;
LDIFReader ldifReader = null;
try {
is = new BufferedReader(new StringReader(ldifFileContent));
ldifReader = new LDIFReader(is);
return importLdifFile(connection, ldifReader);
} finally {
IOUtils.closeQuietly(is);
if (ldifReader != null) {
disposeLdifReader(ldifReader);
}
}
}
Aggregations