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 2026/04/15 11:56:59 UTC

(commons-configuration) 04/05: Javadoc.

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-configuration.git

commit 9bff4e151b317e8e29fd5425af86299dcddf4c06
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Apr 15 07:53:45 2026 -0400

    Javadoc.
    
    Reuse Strings.
---
 src/main/java/org/apache/commons/configuration2/io/FileUtils.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/configuration2/io/FileUtils.java b/src/main/java/org/apache/commons/configuration2/io/FileUtils.java
index 077741235..44c011066 100644
--- a/src/main/java/org/apache/commons/configuration2/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/configuration2/io/FileUtils.java
@@ -22,6 +22,8 @@ import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.commons.lang3.Strings;
+
 /**
  * This class is a subset of org.apache.commons.io.FileUtils, git-svn-id:
  * https://svn.apache.org/repos/asf/commons/proper/io/trunk@1423916 13f79535-47bb-0310-9956-ffa450edef68. The subset is
@@ -86,12 +88,13 @@ final class FileUtils {
      * decoded to {@code /my docs/file.txt}. Starting with version 1.5, this method uses UTF-8 to decode percent-encoded
      * octets to characters. Additionally, malformed percent-encoded octets are handled leniently by passing them through
      * literally.
+     * </p>
      *
      * @param url the file URL to convert, {@code null} returns {@code null}
      * @return the equivalent {@code File} object, or {@code null} if the URL's protocol is not {@code file}
      */
     public static File toFile(final URL url) {
-        if (url == null || !"file".equalsIgnoreCase(url.getProtocol())) {
+        if (url == null || !Strings.CI.equals("file", url.getProtocol())) {
             return null;
         }
         String fileName = url.getFile().replace('/', File.separatorChar);