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