fix: LZMAInputStream not closed
This commit is contained in:
@@ -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()));
|
||||
task.setName(entry.getKey());
|
||||
dependencies.add(task.thenRunAsync(() -> {
|
||||
try {
|
||||
Files.copy(new LZMAInputStream(new FileInputStream(tempFile)), dest);
|
||||
try (LZMAInputStream input = new LZMAInputStream(new FileInputStream(tempFile))) {
|
||||
Files.copy(input, dest);
|
||||
} catch (IOException e) {
|
||||
throw new ArtifactMalformedException("File " + entry.getKey() + " is malformed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user