Here you can find the source of convertFilePathToName(Path file)
public static String convertFilePathToName(Path file)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import com.google.common.io.Files; import java.nio.file.Path; public class Main { /** Turns a file path into a name suitable for use as the name of a premium or reserved list. */ public static String convertFilePathToName(Path file) { return Files.getNameWithoutExtension(file.getFileName().toString()); }//from w ww .jav a2 s.c o m }