Here you can find the source of getNameWithoutSuffix(Path path)
public static String getNameWithoutSuffix(Path path)
//package com.java2s; //License from project: Apache License import java.nio.file.Path; public class Main { public static String getNameWithoutSuffix(Path path) { String name = path.getFileName().toString(); int index = name.lastIndexOf('.'); if (index == -1) { return name; }//from w w w. ja va2s .c o m return name.substring(0, index); } }