static void makeDir(File directory) throws IOException {
        if (directory.exists()) {
            if (!directory.isDirectory()) {
                throw new IOException("File " + directory + " is not directory!");
            }
        } else {
            boolean isCreated = directory.mkdirs();
            if (!isCreated) {
                throw new IOException(String.format("Directory %s can't be created", directory.getAbsolutePath()));
            }
        }
    }
Utils for work with files.

@author Alexey Danilov (danikula@gmail.com).
dkplayer-videocache/src/main/java/com/danikula/videocache/file/Files.java