diff --git a/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java b/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java index 81e3b10d16..c7a92888d7 100644 --- a/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java +++ b/dinky-admin/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java @@ -33,19 +33,26 @@ @Profile("!test") public class RsURLStreamHandlerFactory implements URLStreamHandlerFactory { - private final List notContains = Arrays.asList("jar", "file", "http", "https"); + private static final String PREFIX = "sun.net.www.protocol"; @Override public URLStreamHandler createURLStreamHandler(String protocol) { - if ("rs".equals(protocol)) { + if ("rs".equalsIgnoreCase(protocol)) { return new RsURLStreamHandler(); } - for (String tempProtocol : notContains) { - if (tempProtocol.equals(StrUtil.sub(protocol, 0, tempProtocol.length()))) { - return null; - } + String name = PREFIX + "." + protocol + ".Handler"; + try { + @SuppressWarnings("deprecation") + Object o = Class.forName(name).newInstance(); + return (URLStreamHandler) o; + } catch (ClassNotFoundException x) { + // ignore + } catch (Exception e) { + // For compatibility, all Exceptions are ignored. + // any number of exceptions can get thrown here } + try { Class.forName("org.apache.hadoop.fs.FsUrlStreamHandlerFactory"); } catch (Exception e) { diff --git a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java index 79c22d7c78..b37ba9afc7 100644 --- a/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java +++ b/dinky-app/dinky-app-base/src/main/java/org/dinky/app/flinksql/Submitter.java @@ -259,7 +259,7 @@ public static Optional executeJarJob(String type, Executor executor, ReadableConfig configuration = executor.getStreamExecutionEnvironment().getConfiguration(); List jars = configuration.get(PipelineOptions.JARS); - List jarsUrl = jars.stream().map(URLUtil::getURL).collect(Collectors.toList()); + List jarsUrl = jars.stream().map(URLUtil::url).collect(Collectors.toList()); Pipeline pipeline = executeJarOperation.getStreamGraph(executor.getCustomTableEnvironment(), jarsUrl); if (pipeline instanceof StreamGraph) { // stream job diff --git a/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java b/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java index 7a7dc3c6c2..495ce788f2 100644 --- a/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java +++ b/dinky-client/dinky-client-base/src/main/java/org/dinky/url/RsURLStreamHandlerFactory.java @@ -19,6 +19,7 @@ package org.dinky.url; +import java.net.MalformedURLException; import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; import java.util.Arrays; @@ -28,15 +29,21 @@ public class RsURLStreamHandlerFactory implements URLStreamHandlerFactory { private static final String PREFIX = "sun.net.www.protocol"; - private final List notContains = Arrays.asList("jar", "file", "http", "https"); @Override public URLStreamHandler createURLStreamHandler(String protocol) { - for (String tempProtocol : notContains) { - if (tempProtocol.equals(StrUtil.sub(protocol, 0, tempProtocol.length()))) { - return null; - } + String name = PREFIX + "." + protocol + ".Handler"; + try { + @SuppressWarnings("deprecation") + Object o = Class.forName(name).newInstance(); + return (URLStreamHandler) o; + } catch (ClassNotFoundException x) { + // ignore + } catch (Exception e) { + // For compatibility, all Exceptions are ignored. + // any number of exceptions can get thrown here } + if (ResourceFileSystem.URI_SCHEMA.getScheme().equals(protocol)) { return new RsURLStreamHandler(); } @@ -45,7 +52,6 @@ public URLStreamHandler createURLStreamHandler(String protocol) { } catch (Throwable e) { return null; } - String name = PREFIX + "." + protocol + ".Handler"; try { @SuppressWarnings("deprecation") Object o = Class.forName(name).newInstance(); diff --git a/dinky-metadata/dinky-metadata-paimon/pom.xml b/dinky-metadata/dinky-metadata-paimon/pom.xml index afa612b728..25596c82cf 100644 --- a/dinky-metadata/dinky-metadata-paimon/pom.xml +++ b/dinky-metadata/dinky-metadata-paimon/pom.xml @@ -39,7 +39,7 @@ org.apache.paimon paimon-bundle - 0.8.1 + 0.9.0 ${scope.runtime}