Skip to content
Snippets Groups Projects
Commit f803506f authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Update on tmltranslator: resolving bug on file saving

parent 65305937
No related branches found
No related tags found
No related merge requests found
......@@ -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");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment