Here you can find the source of touchOrCrash(File f)
public static void touchOrCrash(File f) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static void touchOrCrash(File f) throws IOException { if (!f.exists()) { f.getParentFile().mkdirs();//w w w . j a v a2 s .c om f.createNewFile(); } if (!f.isFile()) throw new RuntimeException("\"" + f.getAbsolutePath() + "\" must be a file. Aborting."); } }