use of net.idea.i5.io.I5Options in project ambit-mirror by ideaconsult.
the class Context method importI5Z.
protected int importI5Z(IStructureKey keytomatch, boolean i6, StructureRecordValidator validator) throws Exception {
// validator uses parsertype
setParserType(i6 ? _parsertype.i6z : _parsertype.i5z);
logger_cli.log(Level.INFO, "MSG_IMPORT", new Object[] { String.format("i%sz", i6 ? "6" : "5"), inputFile.getAbsolutePath() });
IZReader reader = null;
Connection c = null;
try {
DBConnectionConfigurable<Context> dbc = null;
dbc = getConnection(getConfigFile());
c = dbc.getConnection();
c.setAutoCommit(true);
I5Options options = new I5Options();
options.setMaxReferenceStructures(maxRefSubstances);
options.setExceptionOnMaxReferenceStructures(false);
options.setAllowMultipleSubstances(false);
if (i6)
reader = new I6ZReader<>(inputFile, options);
else
reader = new I5ZReader<>(inputFile, options);
QASettings qa = new QASettings(false);
qa.setAll();
reader.setQASettings(qa);
matchByKey = keytomatch == null ? new CASKey() : keytomatch;
return write(reader, c, matchByKey, true, clearMeasurements, clearComposition, validator, null, true, false);
} catch (Exception x) {
throw x;
} finally {
if (reader != null)
reader.close();
try {
if (c != null)
c.close();
} catch (Exception x) {
}
}
}
Aggregations