code: public static boolean isExtensionWellFormated(File file, String prefix) {
          String path = file.getAbsolutePath();
          String extension = "";
          int i = path.lastIndexOf('.');
          if (i >= 0) {
              extension = path.substring(i + 1);
          }
          return extension.equalsIgnoreCase(prefix);
      }
docs: Check if the file has the good extension
  @param file
  @param prefix
  @return