Skip to content
Snippets Groups Projects
Commit d3066e6b authored by Lange, Dr. Herbert's avatar Lange, Dr. Herbert
Browse files

properly close file streams and add info when report is saved

parent dba66090
No related branches found
No related tags found
No related merge requests found
Pipeline #12450 passed
...@@ -200,8 +200,15 @@ public class GUI { ...@@ -200,8 +200,15 @@ public class GUI {
} }
try { try {
if (overwrite) { if (overwrite) {
new BufferedInputStream(new FileInputStream(reportFile)) BufferedInputStream bis = new BufferedInputStream(new FileInputStream(reportFile));
.transferTo(new BufferedOutputStream(new FileOutputStream(chooser.getSelectedFile()))); BufferedOutputStream bos =
new BufferedOutputStream(new FileOutputStream(chooser.getSelectedFile()));
bis.transferTo(bos);
bis.close();
bos.close();
JOptionPane.showMessageDialog(window,
"Report saved as " + chooser.getSelectedFile().getPath() + ".",
"Info", JOptionPane.INFORMATION_MESSAGE);
} }
} }
catch (IOException e) { catch (IOException e) {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment