boolean (@NotNull String fileName, @NotNull String extension, boolean caseSensitive) { if (fileName.length() < extension.length() + 1) return false; if (fileName.charAt(fileName.length() - extension.length() - 1) != '.') return false; return StringUtilRt.equal(fileName.subSequence(fileName.length() - extension.length(), fileName.length()), extension, caseSensitive); }