Here you can find the source of checkDirExistence(String dir)
public static void checkDirExistence(String dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void checkDirExistence(String dir) { File f = new File(dir); if (!f.isDirectory()) { throw new RuntimeException("File: " + f + " is not a dir"); }/*from ww w .j av a 2s . c om*/ if (!f.exists()) { throw new RuntimeException("Dir: " + f + " does not exist"); } } }