use of org.openstreetmap.osmosis.tagtransform.StatsSaveException in project osmosis by openstreetmap.
the class TransformHelper method complete.
@Override
public void complete() {
if (statsFile != null && !statsFile.isEmpty()) {
StringBuilder builder = new StringBuilder();
builder.append(configFile);
builder.append("\n\n");
for (Translation t : translations) {
t.outputStats(builder, "");
}
Writer writer = null;
try {
writer = new FileWriter(new File(statsFile));
writer.write(builder.toString());
} catch (IOException e) {
throw new StatsSaveException("Failed to save stats: " + e.getLocalizedMessage(), e);
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
logger.log(Level.WARNING, "Unable to close stats file " + statsFile + ".", e);
}
}
}
}
sink.complete();
}
Aggregations