public ResourceFormatParser getParserForFileExtension ( final String extension ) throws UnsupportedFormatException { for ( final ResourceFormatParser resourceFormatParser : listParsers ( ) ) { if ( resourceFormatParser . getFileExtensions ( ) . contains ( extension ) ) { return resourceFormatParser ; } } throw new UnsupportedFormatException ( "No provider available to parse file extension: " + extension ) ; }
Return a parser for a file based on the bare file extension .