code: public static void mkdir(File dir) throws IOException{
          if(!dir.exists() && !dir.mkdir())
              throw new IOException("couldn't create directory: "+dir);
      }
docs: create specified directory if doesn't exist.