static void mkdirOrThrow(File dir) throws IOException {
    if (!dir.mkdirs() && !dir.isDirectory()) {
      throw new IOException("cannot mkdir: " + dir);
    }
  }
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.

@param dir Directory to create.  All parents created as well.