Here you can find the source of createIfNoExist(String path)
public static void createIfNoExist(String path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { public static void createIfNoExist(String path) throws IOException { File file = new File(path); if (file.exists()) return; if (!file.createNewFile()) throw new IOException("Could not create file: " + path); }/*w w w . j av a2s . c o m*/ }