Add and use Add IOCase.isCaseSensitive(IOCase).
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -53,10 +53,13 @@ The <action> type attribute can be add,update,fix,remove.
</action>
<!-- ADD -->
<action dev="ggregory" type="add" due-to="Gary Gregory">
- Add RegexFileFilter.toString().
+ Add and use RegexFileFilter.toString().
</action>
<action dev="ggregory" type="add" due-to="Gary Gregory">
- Add RegexFileFilter.RegexFileFilter(Pattern, Function&lt;Path&gt;, String>)
+ Add and use RegexFileFilter.RegexFileFilter(Pattern, Function&lt;Path&gt;, String>)
+ </action>
+ <action dev="ggregory" type="add" due-to="Gary Gregory">
+ Add and use IOCase.isCaseSensitive(IOCase).
</action>
</release>
<release version="2.9.0" date="2021-05-22" description="Java 8 required.">

MODIFY
src/main/java/org/apache/commons/io/IOCase.java
src/main/java/org/apache/commons/io/IOCase.java
*/
SYSTEM("System", !FilenameUtils.isSystemWindows());
+ /**
+ * Tests for cases sensitivity in a null-safe manner.
+ *
+ * @param caseSensitivity an IOCase.
+ * @return true if the input is non-null and {@link #isCaseSensitive()}.
+ * @since 2.10.0
+ */
+ public static boolean isCaseSensitive(final IOCase caseSensitivity) {
+ return caseSensitivity != null && !caseSensitivity.isCaseSensitive();
+ }
+
/** Serialization version. */
private static final long serialVersionUID = -6343169151696340687L;

MODIFY
src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java
src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java
@@ -91,7 +91,7 @@ private static Pattern compile(final String pattern, final int flags) {
* @return Pattern compilation flags.
*/
private static int toFlags(final IOCase caseSensitivity) {
- return caseSensitivity != null && !caseSensitivity.isCaseSensitive() ? Pattern.CASE_INSENSITIVE : 0;
+ return IOCase.isCaseSensitive(caseSensitivity) ? Pattern.CASE_INSENSITIVE : 0;
}
/** The regular expression pattern that will be used to match file names. */

Add and use Add IOCase.isCaseSensitive(IOCase).