FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
I can find no way to post to or edit bug#7181278 that I recently posted, so I'm trying a new report that references that one. Please update bug#7181278, delete this addendum, and let me know of a more proper way to update a bug report.
I accidentally copied and pasted a truncated version of the revised uniToPath(uri) method to the original bug report. It was missing the check for the "jar" scheme. Please replace it with the following correct full version.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
static Path uriToPath(URI uri) {
String scheme = uri.getScheme();
if (scheme == null || !scheme.equalsIgnoreCase(getScheme())) {
throw new IllegalArgumentException("URI scheme is not '" + getScheme() + "'");
}
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 exception) {
throw new IllegalArgumentException(exception.getMessage(), exception);
}
}
A DESCRIPTION OF THE PROBLEM :
I can find no way to post to or edit bug#7181278 that I recently posted, so I'm trying a new report that references that one. Please update bug#7181278, delete this addendum, and let me know of a more proper way to update a bug report.
I accidentally copied and pasted a truncated version of the revised uniToPath(uri) method to the original bug report. It was missing the check for the "jar" scheme. Please replace it with the following correct full version.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
static Path uriToPath(URI uri) {
String scheme = uri.getScheme();
if (scheme == null || !scheme.equalsIgnoreCase(getScheme())) {
throw new IllegalArgumentException("URI scheme is not '" + getScheme() + "'");
}
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 exception) {
throw new IllegalArgumentException(exception.getMessage(), exception);
}
}
- duplicates
-
JDK-7156873 (zipfs) FileSystems.newFileSystem(uri, env) fails for uri with escaped octets
-
- Closed
-