Added finally block to TomlWriter#write(Object, File) to close

FileWriter
This commit is contained in:
moandji.ezana 2015-06-29 19:41:44 +02:00
parent feb3aec259
commit 3a3915416a

View file

@ -83,8 +83,11 @@ public class TomlWriter {
*/
public void write(Object from, File target) throws IOException {
FileWriter writer = new FileWriter(target);
write(from, writer);
writer.close();
try {
write(from, writer);
} finally {
writer.close();
}
}
/**