removed custom URLStreamHandlerFactory

This commit is contained in:
2022-05-12 00:00:47 +08:00
parent 662d77d3cd
commit 6ded50d682
3 changed files with 8 additions and 5 deletions

View File

@@ -43,9 +43,6 @@ public class Launcher {
@SneakyThrows
public static void main(String[] args) {
URLManager urlManager = URLManager.getInstance();
urlManager.registerProtocol(PathURLStreamHandler.SCHEME, PathURLStreamHandler.INSTANCE);
URL.setURLStreamHandlerFactory(urlManager);
Enumeration<URL> it = Launcher.class.getClassLoader().getResources(Constants.SYSTEM_PROPERTIES_FILE);
while (it.hasMoreElements()) {
URL url = it.nextElement();

View File

@@ -1,7 +1,10 @@
package envelope.test.jpms;
import java.net.MalformedURLException;
import java.net.URL;
public class Main {
public static void main(String[] args) {
public static void main(String[] args) throws MalformedURLException {
new URL("https://www.google.com");
System.out.println("Hello World!!");
}
}

View File

@@ -1,7 +1,10 @@
package envelope.test.legacy;
import java.net.MalformedURLException;
import java.net.URL;
public class Main {
public static void main(String[] args) {
public static void main(String[] args) throws MalformedURLException {
new URL("https://www.google.com");
System.out.println("Hello World!!");
}
}