Here you can find the source of checkDirectory(final File directory)
public static void checkDirectory(final File directory) throws IOException
//package com.java2s; //License from project: BSD License import java.io.File; import java.io.IOException; public class Main { public static void checkDirectory(final File directory) throws IOException { if (directory.exists()) { if (!directory.isDirectory()) { throw new IOException(directory + " is not a directory"); }// ww w. jav a2 s . c o m } else { throw new IOException(directory + " doesn't exist"); } } }