File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/com/aventstack/extentreports/cucumber/adapter Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 55import java .io .OutputStream ;
66import java .net .URISyntaxException ;
77import java .net .URL ;
8+ import java .nio .file .Paths ;
89import java .util .ArrayList ;
910import java .util .HashMap ;
1011import java .util .List ;
@@ -205,8 +206,9 @@ private static OutputStream createReportFileOutputStream(URL url) {
205206 private URL toUrl (String fileName ) {
206207 try {
207208 Object prop = ExtentService .getProperty (SCREENSHOT_DIR_PROPERTY );
208- String screenshotDir = prop == null ? "test-output/" : String .valueOf (prop );
209- return new URL (new File (screenshotDir ).toURI ().toURL (), fileName );
209+ String screenshotDir = prop == null ? "test-output/" : String .valueOf (prop );
210+ URL url = Paths .get (screenshotDir , fileName ).toUri ().toURL ();
211+ return url ;
210212 } catch (IOException e ) {
211213 throw new CucumberException (e );
212214 }
You can’t perform that action at this time.
0 commit comments