src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
Print this page
*** 63,74 ****
}
try {
// only support legacy JAR URL syntax jar:{uri}!/{entry} for now
String spec = uri.getRawSchemeSpecificPart();
int sep = spec.indexOf("!/");
! if (sep != -1)
spec = spec.substring(0, sep);
return Paths.get(new URI(spec)).toAbsolutePath();
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e.getMessage(), e);
}
}
--- 63,75 ----
}
try {
// only support legacy JAR URL syntax jar:{uri}!/{entry} for now
String spec = uri.getRawSchemeSpecificPart();
int sep = spec.indexOf("!/");
! if (sep != -1) {
spec = spec.substring(0, sep);
+ }
return Paths.get(new URI(spec)).toAbsolutePath();
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e.getMessage(), e);
}
}
*** 105,114 ****
--- 106,118 ----
if (pname.endsWith(".zip") || pname.endsWith(".jar"))
throw ze;
// assume NOT a zip/jar file
throw new UnsupportedOperationException();
}
+ if (realPath == null) { // newly created
+ realPath = path.toRealPath();
+ }
filesystems.put(realPath, zipfs);
return zipfs;
}
}
*** 130,140 ****
}
}
@Override
public Path getPath(URI uri) {
-
String spec = uri.getSchemeSpecificPart();
int sep = spec.indexOf("!/");
if (sep == -1)
throw new IllegalArgumentException("URI: "
+ uri
--- 134,143 ----