code: public File outputDir(File src, File explicitOutputDir, String mapperName) throws IOException {
          File outputDir;
          int prev;
          int idx;
          File subDir;
  
          if (explicitOutputDir == null) {
              outputDir = src.getParentFile();
          } else {
              outputDir = explicitOutputDir;
              idx = mapperName.indexOf('.');
              prev = 0;
              while (idx != -1) {
                  subDir = new File(outputDir, mapperName.substring(prev, idx));
                  if (!subDir.isDirectory()) {
                      if (!subDir.mkdir()) {
                          throw new IOException("cannot create directory: " + subDir);
                      }
                  }
                  prev = idx + 1;
                  idx = mapperName.indexOf('.', prev);
                  outputDir = subDir;
              }
          }
          return outputDir;
      }
docs: creates new directory if necessary.