Here you can find the source of checkDir(String dir)
public static boolean checkDir(String dir)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static boolean checkDir(String dir) { File d = new File(dir); boolean ret = d.exists(); if (ret && d.isFile()) throw new RuntimeException("wrong directory:" + dir); if (!ret) { d.mkdirs();/*from w w w .ja v a2 s. c o m*/ } return ret; } }