public static StructureFiletype guessFiletype ( String filename ) { String lower = filename . toLowerCase ( ) ; for ( StructureFiletype type : StructureFiletype . values ( ) ) { for ( String ext : type . getExtensions ( ) ) { if ( lower . endsWith ( ext . toLowerCase ( ) ) ) { return type ; } } } return StructureFiletype . UNKNOWN ; }
Attempts to guess the type of a structure file based on the extension