Added file removal in finally block
This commit is contained in:
parent
0511aa400e
commit
a43b095b0c
|
@ -103,13 +103,16 @@ public abstract class Record extends CKANPackage {
|
|||
Template tsTemplate = freeMarker.getTemplate("timeseries.ftl");
|
||||
Template template = freeMarker.getTemplate(getType() + ".ftl");
|
||||
Map<String, Object> map = getMapFromSourceJson(node);
|
||||
File transformedJson = getTransformedJsonFile(template,map);
|
||||
jsonNode = mapper.readTree(transformedJson);
|
||||
jsonNode = elaborateTimeSeries(tsTemplate,map);
|
||||
jsonNode = checkTags(jsonNode);
|
||||
jsonNode = checkOrganization(jsonNode);
|
||||
jsonNode = checkGroups(jsonNode);
|
||||
transformedJson.delete();
|
||||
File transformedJson = getTransformedJsonFile(template,map);
|
||||
try {
|
||||
jsonNode = mapper.readTree(transformedJson);
|
||||
jsonNode = elaborateTimeSeries(tsTemplate,map);
|
||||
jsonNode = checkTags(jsonNode);
|
||||
jsonNode = checkOrganization(jsonNode);
|
||||
jsonNode = checkGroups(jsonNode);
|
||||
} finally {
|
||||
transformedJson.delete();
|
||||
}
|
||||
return jsonNode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue