Skip to content

Commit

Permalink
DownloadService create directory if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Axle1975 committed Nov 5, 2021
1 parent 8b4b35a commit 372fff6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/faforever/client/io/DownloadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
public class DownloadService {

public void downloadFile(URL url, Path targetFile, ByteCountListener progressListener) throws IOException {
if (!Files.exists(targetFile.getParent())) {
Files.createDirectories(targetFile.getParent());
}
Path tempFile = Files.createTempFile(targetFile.getParent(), "download", null);

HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
Expand Down

0 comments on commit 372fff6

Please sign in to comment.