Issue #11040 - Deprecate PathResource.SUPPORTED_SCHEMES (#11057)

* Using ResourceFactoryInternals.isSupported(URI) instead.
This commit is contained in:
Joakim Erdfelt 2023-12-14 13:54:11 -06:00 committed by GitHub
parent 8f019b96b0
commit 2812023db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -40,11 +40,11 @@ public class PathResource extends Resource
{
private static final Logger LOG = LoggerFactory.getLogger(PathResource.class);
public static Index<String> SUPPORTED_SCHEMES = new Index.Builder<String>()
.caseSensitive(false)
.with("file")
.with("jrt")
.build();
/**
* @deprecated Using ResourceFactoryInternals.isSupported() instead.
*/
@Deprecated(since = "12.0.4", forRemoval = true)
public static Index<String> SUPPORTED_SCHEMES = new Index.Builder<String>().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))