We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 175eaf3 commit d70da3eCopy full SHA for d70da3e
1 file changed
build/jre/src/Downloader.java
@@ -169,9 +169,11 @@ void download() throws IOException {
169
InputStream input = conn.getInputStream();
170
BufferedInputStream bis = new BufferedInputStream(input);
171
File outputFile = new File(path); //folder, filename);
172
+ // Write to a temp file so that we don't have an incomplete download
173
+ // masquerading as a good archive.
174
File tempFile = File.createTempFile("download", "", outputFile.getParentFile());
175
BufferedOutputStream output =
- new BufferedOutputStream(new FileOutputStream(tempFile));
176
+ new BufferedOutputStream(new FileOutputStream(tempFile));
177
int c = bis.read();
178
while (c != -1) {
179
output.write(c);
0 commit comments