Skip to content

Commit 714ffb0

Browse files
committed
cleaning up the download
1 parent 316293f commit 714ffb0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/neuronrobotics/bowlerstudio/scripting/DownloadManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,9 +1008,13 @@ private static void rawFileDownload(ProcessInputStream pis, File folder, File ou
10081008
}
10091009
fileOutputStream.close();
10101010
pis.close();
1011-
Files.copy(exe.toPath(), new FileOutputStream(output.getAbsoluteFile()));
1011+
FileOutputStream out = new FileOutputStream(output.getAbsoluteFile());
1012+
Files.copy(exe.toPath(), out);
1013+
out.flush();
1014+
out.close();
10121015
} catch (Exception ex) {
10131016
ex.printStackTrace();
1017+
output.delete();
10141018
}
10151019
exe.delete();
10161020
}

0 commit comments

Comments
 (0)