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