[FIX] Downloader downloadList truncate file

This commit is contained in:
Gravita 2024-07-21 19:48:55 +07:00
parent c2926b5b40
commit 7d7485afdc
No known key found for this signature in database
GPG key ID: 543A8F335C9CD633

View file

@ -256,7 +256,7 @@ protected HttpRequest makeHttpRequest(URI baseUri, String filePath) throws URISy
} }
protected ProgressTrackingBodyHandler<Path> makeBodyHandler(Path file, DownloadCallback callback) { protected ProgressTrackingBodyHandler<Path> makeBodyHandler(Path file, DownloadCallback callback) {
return new ProgressTrackingBodyHandler<>(HttpResponse.BodyHandlers.ofFile(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE), callback); return new ProgressTrackingBodyHandler<>(HttpResponse.BodyHandlers.ofFile(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING), callback);
} }
public interface DownloadCallback { public interface DownloadCallback {