You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2020/01/26 16:52:56 UTC

[incubator-datasketches-java] branch master updated: Fix for issue#296: InvalidPathException on Windows

This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-java.git


The following commit(s) were added to refs/heads/master by this push:
     new 565b2d3  Fix for issue#296: InvalidPathException on Windows
     new b2937a9  Merge pull request #297 from paulk-asert/issue296
565b2d3 is described below

commit 565b2d361f6ad716283d0e1bf47832db3df481fd
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Jan 26 22:00:29 2020 +1000

    Fix for issue#296: InvalidPathException on Windows
---
 src/main/java/org/apache/datasketches/Util.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/datasketches/Util.java b/src/main/java/org/apache/datasketches/Util.java
index 4c8fe7f..a3d4ceb 100644
--- a/src/main/java/org/apache/datasketches/Util.java
+++ b/src/main/java/org/apache/datasketches/Util.java
@@ -733,7 +733,7 @@ public final class Util {
     try {
       final URL url = Util.class.getClassLoader().getResource(shortFileName);
       final URI uri = url.toURI();
-      final String path = uri.getPath(); //decodes any special characters
+      final String path = uri.isAbsolute() ? Paths.get(uri).toAbsolutePath().toString() : uri.getPath();  //decodes any special characters
       return path;
     } catch (final NullPointerException | URISyntaxException e) {
       throw new SketchesArgumentException("Cannot find resource: " + shortFileName + LS + e);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org