try {
equivalenceHeader = equivalenceParser.parseEquivalence(
resourceLocation, rawEquivalence);
characterStopOffset = equivalenceParser.getNextCharacterOffset();
} catch (IOException e) {
throw new IndexingFailure(name, e);
} catch (BELDataMissingPropertyException e) {
throw new IndexingFailure(name, e);
} catch (BELDataConversionException e) {
throw new IndexingFailure(name, e);
}
final EquivalenceBlock eqblock =
equivalenceHeader.getEquivalenceBlock();
final String eqhome = equivalenceHomeFile.getAbsolutePath();
String eqname = eqblock.getNameString().replace(' ', '-');
String eqversion = eqblock.getVersionString().replace(' ', '-');
String path = asPath(eqhome, eqname, eqversion);
createDirectories(path);
final String outputPath = asPath(path, "equivalence.header");
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(new FileOutputStream(outputPath));
oos.writeObject(equivalenceHeader);
return new File(outputPath);
} catch (IOException e) {
final String msg = "Error writing equivalencer header.";
throw new IndexingFailure(resourceLocation, msg, e);
} finally {
if (oos != null) {
try {
oos.close();
} catch (IOException e) {}