From 2812023db332f82f155e2db06e1e2855f73f1215 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 14 Dec 2023 13:54:11 -0600 Subject: [PATCH] Issue #11040 - Deprecate PathResource.SUPPORTED_SCHEMES (#11057) * Using ResourceFactoryInternals.isSupported(URI) instead. --- .../eclipse/jetty/util/resource/PathResource.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java index 405e246a33c..55ac974611a 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java @@ -40,11 +40,11 @@ public class PathResource extends Resource { private static final Logger LOG = LoggerFactory.getLogger(PathResource.class); - public static Index SUPPORTED_SCHEMES = new Index.Builder() - .caseSensitive(false) - .with("file") - .with("jrt") - .build(); + /** + * @deprecated Using ResourceFactoryInternals.isSupported() instead. + */ + @Deprecated(since = "12.0.4", forRemoval = true) + public static Index SUPPORTED_SCHEMES = new Index.Builder().build(); // The path object represented by this instance private final Path path; @@ -164,7 +164,7 @@ public class PathResource extends Resource { if (!uri.isAbsolute()) throw new IllegalArgumentException("not an absolute uri: " + uri); - if (!bypassAllowedSchemeCheck && !SUPPORTED_SCHEMES.contains(uri.getScheme())) + if (!bypassAllowedSchemeCheck && !ResourceFactoryInternals.isSupported(uri.getScheme())) throw new IllegalArgumentException("not an allowed scheme: " + uri); if (Files.isDirectory(path))