Skip to content

Commit d70da3e

Browse files
committed
add a note about purpose here
1 parent 175eaf3 commit d70da3e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

build/jre/src/Downloader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ void download() throws IOException {
169169
InputStream input = conn.getInputStream();
170170
BufferedInputStream bis = new BufferedInputStream(input);
171171
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.
172174
File tempFile = File.createTempFile("download", "", outputFile.getParentFile());
173175
BufferedOutputStream output =
174-
new BufferedOutputStream(new FileOutputStream(tempFile));
176+
new BufferedOutputStream(new FileOutputStream(tempFile));
175177
int c = bis.read();
176178
while (c != -1) {
177179
output.write(c);

0 commit comments

Comments
 (0)