You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/23 14:28:17 UTC
(commons-io) branch master updated: Refactor magic string
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 519883d65 Refactor magic string
519883d65 is described below
commit 519883d65c6466a69f1f6d581b66a6d6b67b902d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 23 10:28:11 2024 -0400
Refactor magic string
---
src/main/java/org/apache/commons/io/file/spi/FileSystemProviders.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/io/file/spi/FileSystemProviders.java b/src/main/java/org/apache/commons/io/file/spi/FileSystemProviders.java
index a64b4e769..a5d3241f2 100644
--- a/src/main/java/org/apache/commons/io/file/spi/FileSystemProviders.java
+++ b/src/main/java/org/apache/commons/io/file/spi/FileSystemProviders.java
@@ -33,6 +33,7 @@ import java.util.Objects;
*/
public class FileSystemProviders { // NOPMD Class will be final in 3.0.
+ private static final String SCHEME_FILE = "file";
private static final FileSystemProviders INSTALLED = new FileSystemProviders(FileSystemProvider.installedProviders());
/**
@@ -75,7 +76,7 @@ public class FileSystemProviders { // NOPMD Class will be final in 3.0.
public FileSystemProvider getFileSystemProvider(final String scheme) {
Objects.requireNonNull(scheme, "scheme");
// Check default provider first to avoid loading of installed providers.
- if (scheme.equalsIgnoreCase("file")) {
+ if (scheme.equalsIgnoreCase(SCHEME_FILE)) {
return FileSystems.getDefault().provider();
}
// Find provider.