Skip to content

Commit

Permalink
Make directories taking into account root
Browse files Browse the repository at this point in the history
  • Loading branch information
galderz committed Feb 15, 2021
1 parent 663624f commit 392d017
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/mendrugo/qollider/Web.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.file.Path;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;

Expand All @@ -23,10 +24,11 @@ static void download(Step.Download download)
Channels.newChannel(download.url().openStream())
);

final var path = download.root().resolve(download.path());

// Create any parent directories as needed
FileTree.mkdirs(download.path().getParent());
FileTree.mkdirs(path.getParent());

final var path = download.root().resolve(download.path());
final var os = new FileOutputStream(path.toFile());
final var fileChannel = os.getChannel();

Expand Down

0 comments on commit 392d017

Please sign in to comment.