public static String guessFormat(String name){
  String ext=FileUtil.getFilenameExtension(name);
  for (  String format : FORMATS) {
    if (format.equals(ext)) {
      return ext;
    }
  }
  return null;
}

public static String guessFormat ( String name ) { String ext = FileUtil . getFilenameExtension ( name ) ; for ( String format : FORMATS ) { if ( format . equals ( ext ) ) { return ext ; } } return null ; }
guess a supported format from the file name . for " auto " format handling .
