private Exception exportEntries(CaDbEntryType type, CertstoreType certstore,
File processLogFile, Long idProcessedInLastProcess) {
String tablesText = "table " + type.getTableName();
File dir = new File(baseDir, type.getDirName());
dir.mkdirs();
FileOutputStream entriesFileOs = null;
try {
entriesFileOs = new FileOutputStream(new File(baseDir, type.getDirName() + ".mf"), true);
exportEntries(type, certstore, processLogFile, entriesFileOs, idProcessedInLastProcess);
return null;
} catch (Exception ex) {
deleteTmpFiles(baseDir, "tmp-");
System.err.println("\nexporting " + tablesText + " has been cancelled due to error,\n"
+ "please continue with the option '--resume'");
LOG.error("Exception", ex);
return ex;
} finally {
if (entriesFileOs != null) {
IoUtil.closeStream(entriesFileOs);
}
}
}