Commit f803506f authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Update on tmltranslator: resolving bug on file saving

parent 65305937
......@@ -408,11 +408,12 @@ public class TMLTranslator {
private static boolean saveData() {
try {
System.out.println("Writing data in " + outputFile.getAbsolutePath() + " data=" + outputData);
FileOutputStream fos = new FileOutputStream(outputFile);
fos.write(outputData.getBytes());
fos.close();
} catch (Exception e) {
System.out.println("Error when writing output file");
System.out.println("Error when writing output file: " + e.getMessage());
return false;
}
return true;
......@@ -515,11 +516,14 @@ public class TMLTranslator {
System.out.println("Conversion done");
if (!saveData()) {
return;
if (outputData != null) {
if (!saveData()) {
return;
}
System.out.println("Specification written in " + outputFile.getName() + ": " + outputData.length() + " bytes");
}
System.out.println("Specification written in " + outputFile.getName() + ": " + outputData.length() + " bytes");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment