code: private static File makeOutputFile(String outputDir, String packageName, String className)
          throws IOException {
          
          // Convert the package name to a path
          Pattern pattern=Pattern.compile("\\.");
          Matcher matcher=pattern.matcher(packageName);
          String sepToUse=File.separator;
          if (sepToUse.equals("\\")) {
              sepToUse="\\\\";
          }
  
          // Try to create the necessary directories
          String directoryPath=outputDir+File.separator+matcher.replaceAll(sepToUse);
          File directory=new File(directoryPath);
          File outputFile=new File(directory, className+".java");
          
          LOG.debug(String.format("Attempting to create output file at %1$s", outputFile.getAbsolutePath()));
          
          try {
              directory.mkdirs();
              outputFile.createNewFile();
          } catch (SecurityException se) {
              throw new IOException(String.format("Can't write to output file %1$s", outputFile.getAbsoluteFile()), se);
          } catch (IOException ioe) {
              throw new IOException(String.format("Can't write to output file %1$s", outputFile.getAbsoluteFile()), ioe);
          }
          
          return outputFile;
      }
docs: Create the output file for the generated code along with all intervening directories