static void mkdirOrThrow ( File dir ) throws IOException { if ( ! dir . mkdirs ( ) && ! dir . isDirectory ( ) ) { throw new IOException ( "cannot mkdir: " + dir ) ; } }
Like File . mkdirs but throws on error . Succeeds even if File . mkdirs fails but dir still names a directory .