}
if( registry.getHeatSets().size()>0 ) {
try {
writer.initialize(baseDir, HeatSetIO.sourceFilename());
new HeatSetIO(factory(), null, writer, registry).exportData(registry.getHeatSets());
} catch (IOException e) {
e.printStackTrace();
}
} else {
// the file may still exist if heatsets have just been removed, so we delete it now