Here you can find the source of getFileExtension(Path path)
public static String getFileExtension(Path path)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; public class Main { public static String getFileExtension(Path path) { String fname = path.getFileName().toString(); return fname.substring(fname.lastIndexOf('.') + 1); }// w w w.jav a 2s . c o m }