Here you can find the source of stripExtension(Path path, String extension)
public static String stripExtension(Path path, String extension)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; public class Main { public static String stripExtension(Path path, String extension) { String fileName = path.toString(); return fileName.substring(0, fileName.toLowerCase().indexOf(extension)); }/* w w w . j a v a 2 s . c o m*/ }