public static String getExtension ( String fileName ) { int dot = fileName . lastIndexOf ( ' ' ) ; return dot == - 1 ? null : fileName . substring ( dot + 1 ) ; }
Returns extension of the file . Returns null if there is no extension