private boolean entryExists(Connection conn,DN dn) throws UpgradeException {
  try {
    conn.readEntry(dn,"dn");
  }
 catch (  EntryNotFoundException enfe) {
    return false;
  }
catch (  LdapException ere) {
    DEBUG.error("Unable to read entry with dn: " + dn,ere);
    throw new UpgradeException(ere);
  }
  return true;
}

private boolean entryExists ( Connection conn , DN dn ) throws UpgradeException { try { conn . readEntry ( dn , "dn" ) ; } catch ( EntryNotFoundException enfe ) { return false ; } catch ( LdapException ere ) { DEBUG . error ( "Unable to read entry with dn: " + dn , ere ) ; throw new UpgradeException ( ere ) ; } return true ; }
as its name says , this method checks if a given entry exists in the directory or not .
