public static boolean hasExtension(Path path, String extension) {
    return path.toString().toLowerCase().endsWith("." + extension.toLowerCase());
  }
Returns true if {@code path} ends with ".extension" (case-insensitive).
planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java