< prev index next >

src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java

Print this page
rev 55068 : 8224908: Revert: 8216553: JrtFileSystemProvider getPath(URI) omits /modules element from file path
Reviewed-by:

@@ -23,11 +23,10 @@
  * questions.
  */
 package jdk.internal.jrtfs;
 
 import java.io.File;
-import java.io.IOError;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URI;
 import java.net.URISyntaxException;

@@ -169,20 +168,11 @@
     }
 
     @Override
     public final URI toUri() {
         try {
-            String p = toAbsolutePath().path;
-            if (!p.startsWith("/modules") || p.contains("..")) {
-                throw new IOError(new RuntimeException(p + " cannot be represented as URI"));
-            }
-
-            p = p.substring("/modules".length());
-            if (p.isEmpty()) {
-                p = "/";
-            }
-            return new URI("jrt", p, null);
+            return new URI("jrt", toAbsolutePath().path, null);
         } catch (URISyntaxException ex) {
             throw new AssertionError(ex);
         }
     }
 
< prev index next >