< prev index next >
src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
Print this page
*** 26,36 ****
package jdk.internal.loader;
import java.io.IOException;
import java.net.URL;
import java.nio.file.InvalidPathException;
! import java.nio.file.Paths;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.util.jar.Manifest;
import jdk.internal.misc.JavaLangAccess;
--- 26,36 ----
package jdk.internal.loader;
import java.io.IOException;
import java.net.URL;
import java.nio.file.InvalidPathException;
! import java.nio.file.Path;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.util.jar.Manifest;
import jdk.internal.misc.JavaLangAccess;
*** 221,231 ****
private static URL toFileURL(String s) {
try {
// Use an intermediate File object to construct a URI/URL without
// authority component as URLClassPath can't handle URLs with a UNC
// server name in the authority component.
! return Paths.get(s).toRealPath().toFile().toURI().toURL();
} catch (InvalidPathException | IOException ignore) {
// malformed path string or class path element does not exist
return null;
}
}
--- 221,231 ----
private static URL toFileURL(String s) {
try {
// Use an intermediate File object to construct a URI/URL without
// authority component as URLClassPath can't handle URLs with a UNC
// server name in the authority component.
! return Path.get(s).toRealPath().toFile().toURI().toURL();
} catch (InvalidPathException | IOException ignore) {
// malformed path string or class path element does not exist
return null;
}
}
< prev index next >