mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-11 12:56:53 -04:00
fix: LZMAInputStream not closed
This commit is contained in:
parent
665b0c4390
commit
faede16662
@ -98,8 +98,8 @@ public class JavaDownloadTask extends Task<Void> {
|
|||||||
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(download.getUrl()), tempFile, new FileDownloadTask.IntegrityCheck("SHA-1", download.getSha1()));
|
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(download.getUrl()), tempFile, new FileDownloadTask.IntegrityCheck("SHA-1", download.getSha1()));
|
||||||
task.setName(entry.getKey());
|
task.setName(entry.getKey());
|
||||||
dependencies.add(task.thenRunAsync(() -> {
|
dependencies.add(task.thenRunAsync(() -> {
|
||||||
try {
|
try (LZMAInputStream input = new LZMAInputStream(new FileInputStream(tempFile))) {
|
||||||
Files.copy(new LZMAInputStream(new FileInputStream(tempFile)), dest);
|
Files.copy(input, dest);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ArtifactMalformedException("File " + entry.getKey() + " is malformed");
|
throw new ArtifactMalformedException("File " + entry.getKey() + " is malformed");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user