question: public static void forceMkdir ( File directory ) throws IOException { if ( directory . exists ( ) ) { if ( ! directory . isDirectory ( ) ) { String message = "File " + directory + " exists and is " + "not a directory. Unable to create directory." ; throw new IOException ( message ) ; } } else { if ( ! directory . mkdirs ( ) ) { if ( ! directory . isDirectory ( ) ) { String message = "Unable to create directory " + directory ; throw new IOException ( message ) ; } } } }
target:  Makes a directory, including any necessary but nonexistent parent directories. If a file already exists with specified name but it is not a directory then an IOException is thrown. If the directory cannot be created (or does not already exist) then an IOException is thrown.