Close file handler for apktool.yml .

This commit is contained in:
Ryszard Wiśniewski 2010-09-18 15:16:17 +02:00
parent 3de632f04c
commit 8171245457

View File

@ -116,10 +116,19 @@ public class Androlib {
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
// options.setIndent(4);
Yaml yaml = new Yaml(options);
FileWriter writer = null;
try {
yaml.dump(meta, new FileWriter(new File(mOutDir, "apktool.yml")));
writer = new FileWriter(new File(mOutDir, "apktool.yml"));
yaml.dump(meta, writer);
} catch (IOException ex) {
throw new AndrolibException(ex);
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException ex) {}
}
}
}