Here you can find the source of getFileExtension(String fileName)
public static String getFileExtension(String fileName)
//package com.java2s; public class Main { public static String getFileExtension(String fileName) { int index = fileName.lastIndexOf("."); if (index == -1) return null; return fileName.substring(index + 1); }/*from w w w.ja va2 s . c o m*/ }