Here you can find the source of createFile(Path path)
public static void createFile(Path path)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.FileAlreadyExistsException; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void createFile(Path path) { try {/*from w w w . j av a 2 s . c o m*/ Files.createFile(path); } catch (FileAlreadyExistsException e) { } catch (IOException e) { throw new RuntimeException(e); } } }