Skip to content

Commit

Permalink
Allows space in images folder
Browse files Browse the repository at this point in the history
  • Loading branch information
grass-hopper-moc committed Aug 11, 2020
1 parent 16833d1 commit 15795f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private static void writeBytesToURL(byte[] buf, URL url) throws IOException {
private static OutputStream createReportFileOutputStream(URL url) {
try {
return new URLOutputStream(url);
} catch (IOException e) {
} catch (IOException | URISyntaxException e) {
throw new CucumberException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.Map;
Expand All @@ -28,17 +29,18 @@ class URLOutputStream extends OutputStream {
private final OutputStream out;
private final HttpURLConnection urlConnection;

URLOutputStream(URL url) throws IOException {
URLOutputStream(URL url) throws IOException, URISyntaxException {
this(url, "PUT", Collections.emptyMap(), 200);
}

private URLOutputStream(URL url, String method, Map<String, String> headers, int expectedResponseCode)
throws IOException {
throws IOException, URISyntaxException {
this.url = url;
this.method = method;
this.expectedResponseCode = expectedResponseCode;
if (url.getProtocol().equals("file")) {
File file = new File(url.getFile());
//File file = new File(url.getFile());
File file = new File(url.toURI().getPath());
ensureParentDirExists(file);
out = new FileOutputStream(file);
urlConnection = null;
Expand Down

0 comments on commit 15795f3

Please sign in to comment.