docs: private static String createIfNeeded(String dir) {
          File f = new File(dir);
          if (f.exists()) {
              return dir;
          } else {
              boolean success = f.mkdirs();
              if (success)
                  return dir;
              else
                  return null;
          }
      }