Skip to content

Commit

Permalink
Fix BuildManifest download when direct download is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
airsquared committed Jul 20, 2023
1 parent 9774153 commit d0c72a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/airsquared/blobsaver/app/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ static void makeVoidRequest(String url) throws IOException, InterruptedException
}

static HttpResponse<Path> downloadFile(String url, Path dir) throws IOException, InterruptedException {
return httpClient.send(HttpRequest.newBuilder(URI.create(url)).build(),
var response = httpClient.send(HttpRequest.newBuilder(URI.create(url)).build(),
HttpResponse.BodyHandlers.ofFile(dir, WRITE, CREATE, TRUNCATE_EXISTING));
if (response.statusCode() != 200) {
throw new IOException("HTTP Response was " + response);
}
return response;
}

/**
Expand Down

0 comments on commit d0c72a3

Please sign in to comment.