Here you can find the source of getExtension(final Path path)
public static String getExtension(final Path path)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; public class Main { public static String getExtension(final Path path) { int i = path.toString().lastIndexOf("."); if (i >= 0) { return path.toString().substring(i + 1); }/*www . j a v a 2 s .c om*/ return ""; } }