Skip to content

Commit

Permalink
Issue #11040 - Deprecate PathResource.SUPPORTED_SCHEMES (#11057)
Browse files Browse the repository at this point in the history
* Using ResourceFactoryInternals.isSupported(URI) instead.
  • Loading branch information
joakime authored Dec 14, 2023
1 parent 8f019b9 commit 2812023
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -164,7 +164,7 @@ public static boolean isSameName(Path pathA, Path pathB)
{
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))
Expand Down

0 comments on commit 2812023

Please sign in to comment.