Here you can find the source of getFileInFolder(Path p, String filename)
private static File getFileInFolder(Path p, String filename) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; public class Main { private static File getFileInFolder(Path p, String filename) throws IOException { Path path = Paths.get(p.toString(), filename); File f = new File(path.toString()); f.createNewFile();// w w w . j a v a 2s.com return f; } }