Skip to content

Commit 3e3145e

Browse files
committed
TIKA-4397: replace deprecated
1 parent 7c7db73 commit 3e3145e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tika-core/src/main/java/org/apache/tika/config/TikaConfig.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.io.InputStream;
2424
import java.lang.reflect.Constructor;
2525
import java.lang.reflect.InvocationTargetException;
26+
import java.net.URI;
27+
import java.net.URISyntaxException;
2628
import java.net.URL;
2729
import java.nio.file.Files;
2830
import java.nio.file.Path;
@@ -352,8 +354,8 @@ private static InputStream getConfigInputStream(String config, ServiceLoader ser
352354
throws TikaException, IOException {
353355
InputStream stream = null;
354356
try {
355-
stream = new URL(config).openStream();
356-
} catch (IOException ignore) {
357+
stream = new URI(config).toURL().openStream();
358+
} catch (IOException | URISyntaxException ignore) {
357359
}
358360
if (stream == null) {
359361
stream = serviceLoader.getResourceAsStream(config);

0 commit comments

Comments
 (0)