private static void mkdir ( @ NonNull final File directory , final boolean createParents ) throws IOException { Condition . INSTANCE . ensureNotNull ( directory , "The directory may not be null" ) ; boolean result = createParents ? directory . mkdirs ( ) : directory . mkdir ( ) ; if ( ! result && ! directory . exists ( ) ) { throw new IOException ( "Failed to create directory \"" + directory + "\"" ) ; } }
Creates a specific directory if it does not already exist .