Here you can find the source of createFile(Path p)
private static void createFile(Path p)
//package com.java2s; //License from project: LGPL import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.nio.file.Path; public class Main { private static void createFile(Path p) { try {/*w ww . ja v a 2 s . c o m*/ PrintWriter writer = new PrintWriter(p.toString(), "UTF-8"); writer.println(p.toString()); writer.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } }