Here you can find the source of createFile(Path path)
public static void createFile(Path path) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.nio.file.Path; public class Main { public static void createFile(Path path) throws IOException { File file = path.toFile(); if (file.exists()) { file.delete();//from w w w . j a v a 2 s . com } file.createNewFile(); } }