Here you can find the source of fileExtension(String path)
public static String fileExtension(String path)
//package com.java2s; //License from project: LGPL public class Main { public static String fileExtension(String path) { int token = path.lastIndexOf("."); String ext = path.substring(token + 1, path.length()).toLowerCase(); return ext; }/*from w ww . j ava 2 s.c om*/ }