public static String getExtension ( File file ) { Assert . notNull ( file , "File cannot be null" ) ; String filename = file . getName ( ) ; int dotIndex = filename . indexOf ( StringUtils . DOT_SEPARATOR ) ; return ( dotIndex != - 1 ? filename . substring ( dotIndex + 1 ) : StringUtils . EMPTY_STRING ) ; }
Returns the extension of the given file .