mirror of
https://github.com/SKCraft/Launcher.git
synced 2025-01-21 21:31:32 +01:00
Only append to partially downloaded files if HTTP response is a 206
This commit is contained in:
parent
4552b76465
commit
cf7e12b4d1
@ -290,9 +290,10 @@ public class HttpRequest implements Closeable, ProgressObservable {
|
||||
public HttpRequest saveContent(File file) throws IOException, InterruptedException {
|
||||
FileOutputStream fos = null;
|
||||
BufferedOutputStream bos = null;
|
||||
boolean shouldAppend = resumeInfo != null && getResponseCode() == 206;
|
||||
|
||||
try {
|
||||
fos = new FileOutputStream(file, resumeInfo != null);
|
||||
fos = new FileOutputStream(file, shouldAppend);
|
||||
bos = new BufferedOutputStream(fos);
|
||||
|
||||
saveContent(bos);
|
||||
|
Loading…
Reference in New Issue
Block a user