Here you can find the source of extractFileExtension(String fileName)
public static String extractFileExtension(String fileName)
//package com.java2s; //License from project: Open Source License public class Main { public static String extractFileExtension(String fileName) { if (null == fileName || "".equals(fileName.trim())) { throw new IllegalArgumentException("File Name cannot be Null/Empty"); }/*www . j a v a 2 s . c om*/ int extensionStartPt = fileName.lastIndexOf("."); return fileName.substring(extensionStartPt + 1); } }