boolean (@NotNull File file, boolean isCheckIsDirectory) { if (isCheckIsDirectory && file.isDirectory()) { return false; } // do not use getName to avoid extra String creation (File.getName() calls substring) String path = file.getPath(); return StringUtilRt.endsWithIgnoreCase(path, ".jar") || StringUtilRt.endsWithIgnoreCase(path, ".zip"); }