Convert the Classes in the given Package to an HTML.

@param pd the Package to convert.
@param outputdir the name of the directory to output to.
184688
public void convertPackage(PackageDoc pd, DocPath outputdir) {
        if (pd == null) {
            return;
        }
        ClassDoc[] cds = pd.allClasses();
        for (int i = 0; i < cds.length; i++) {
            // If -nodeprecated option is set and the class is marked as deprecated,
            // do not convert the package files to HTML. We do not check for
            // containing package deprecation since it is already check in
            // the calling method above.
            if (!(configuration.nodeprecated && Util.isDeprecated(cds[i])))
                convertClass(cds[i], outputdir);
        }
    }
1063666
public void copyTex4htOutputToOutputFolder( File texFile, File tempDirectory, File tex4htOutputDirectory,
                                                File outputDirectory )
        throws MojoExecutionException, MojoFailureException
    {
        File[] outputFiles = tex4htOutputDirectory.listFiles();

        if ( outputFiles == null || outputFiles.length == 0 )
        {
            log.warn( "LaTeX file " + texFile + " did not generate any output in " + tex4htOutputDirectory + "!" );
        }
        else
        {
            File targetDirectory = getTargetDirectory( texFile, tempDirectory, outputDirectory );
            copyFilesToDirectory( outputFiles, targetDirectory );
        }
    }
830303
private IRenderer buildRenderer(
			File outputDirectory,
			ApplicationTemplate applicationTemplate,
			File applicationDirectory,
			Renderer renderer,
			Map<String,String> typeAnnotations ) {

		IRenderer result = null;
		switch( renderer ) {
		case HTML:
			result = new HtmlRenderer( outputDirectory, applicationTemplate, applicationDirectory, typeAnnotations );
			break;

		case MARKDOWN:
			result = new MarkdownRenderer( outputDirectory, applicationTemplate, applicationDirectory, typeAnnotations );
			break;

		case FOP:
			result = new FopRenderer( outputDirectory, applicationTemplate, applicationDirectory, typeAnnotations );
			break;

		case PDF:
			result = new PdfRenderer( outputDirectory, applicationTemplate, applicationDirectory, typeAnnotations );
			break;

		default:
			break;
		}

		return result;
	}
118619
private void initOutputDir(File outputDir) {

        if (!outputDir.exists()) {
            if (!outputDir.mkdirs()) {
                throw new IllegalArgumentException("Output Directory "+outputDir+" could not be created");
            }
        }
        if (!outputDir.isDirectory() || (!outputDir.canWrite())) {
            throw new IllegalArgumentException("Output Directory "+outputDir+" is not a directory or cannot be written to.");
        }
    }
16518
public static File earlHtmlReport( String outputDir )
                    throws FileNotFoundException {

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath();
        String earlXsl = cl.getResource( "com/occamlab/te/earl_html_report.xsl" ).toString();

        File htmlOutput = new File( outputDir, "result" );
        htmlOutput.mkdir();
        LOGR.fine( "HTML output is written to directory " + htmlOutput );
        File earlResult = new File( outputDir, "earl-results.rdf" );

        try {
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer transformer = tf.newTransformer( new StreamSource( earlXsl ) );
            transformer.setParameter( "outputDir", htmlOutput );
            File indexHtml = new File( htmlOutput, "index.html" );
            indexHtml.createNewFile();
            FileOutputStream outputStream = new FileOutputStream( indexHtml );
            transformer.transform( new StreamSource( earlResult ), new StreamResult( outputStream ) );
            // Foritfy Mod: Close the outputStream releasing its resources
            outputStream.close();
            FileUtils.copyDirectory( new File( resourceDir ), htmlOutput );
        } catch ( Exception e ) {
            LOGR.log( Level.SEVERE, "Transformation of EARL to HTML failed.", e );
            throw new RuntimeException( e );
        }
        if ( !htmlOutput.exists() ) {
            throw new FileNotFoundException( "HTML results not found at " + htmlOutput.getAbsolutePath() );
        }
        return htmlOutput;
    }
1134146
public final void setDatabaseOutputDir(String databaseOutputDir) {
        if (DEBUG) {
            System.out.println("Setting database output directory: " + databaseOutputDir);
        }
        this.databaseOutputDir = databaseOutputDir;
    }
643838
public static void setOutputPath(JobConf conf, Path outputDir) {
    if (!outputDir.isAbsolute()) {
      FileSystem.LogForCollect.info("set output path to relative path: "
          + outputDir + " working directory: " + conf.getWorkingDirectory());
    }
    outputDir = new Path(conf.getWorkingDirectory(), outputDir);
    conf.set("mapred.output.dir", outputDir.toString());
  }
927698
public static String exportToHtml(Option option) {
        String folderPath = System.getProperty("java.io.tmpdir");
        return exportToHtml(option, folderPath);
    }
1118087
private void checkOutDirWritable(File outputDirectory) throws MojoExecutionException {
		if (!outputDirectory.exists()) {
			checkIfOutputCanBeCreated();
			checkIfOutputDirIsWritable();
			if (verbose) {
				log.info("Output dir check OK");
			}
		}
		else if (!outputDirectory.canWrite()) {
			throw new MojoExecutionException(
					"The output dir exists but was not writable. "
							+ "Try running maven with the 'clean' goal.");
		}
	}
834758
public static void setOutputPath(Job job, Path outputDir) {
    job.getConfiguration().set("mapred.output.dir", outputDir.toString());
  }
33061
private static synchronized FileOutputWriter createFileWriter(final TypeDefinition type, final DecompilerSettings settings)
                throws IOException
    {
        final String outputDirectory = settings.getOutputDirectory();

        final String fileName = type.getName() + settings.getLanguage().getFileExtension();
        final String packageName = type.getPackageName();

        // foo.Bar -> foo/Bar.java
        final String subDir = StringUtils.defaultIfEmpty(packageName, "").replace('.', File.separatorChar);
        final String outputPath = PathHelper.combine(outputDirectory, subDir, fileName);

        final File outputFile = new File(outputPath);
        final File parentDir = outputFile.getParentFile();

        if (parentDir != null && !parentDir.exists() && !parentDir.mkdirs())
        {
            throw new IllegalStateException("Could not create directory:" + parentDir);
        }

        if (!outputFile.exists() && !outputFile.createNewFile())
        {
            throw new IllegalStateException("Could not create output file: " + outputPath);
        }

        return new FileOutputWriter(outputFile, settings);
    }
99965
def render_template_directory(deck, arguments):
    """"""
    output_directory = dir_name_from_title(deck.title)

    if os.path.exists(output_directory):
        if sys.stdout.isatty():
            if ask(
                '%s already exists, shall I delete it?' % output_directory,
                arguments.get('--noinput')
            ):
                shutil.rmtree(output_directory)
        else:
            shutil.rmtree(output_directory)

    # copy support files to output directory
    template_directory_path = (
        '%s/templates/%s' %
        (remarkable.__path__[0], deck.presentation_type)
    )
    shutil.copytree(
        template_directory_path,
        output_directory,
    )

    # copy resources
    if os.path.exists('resources'):
        log.info('Copying resources')
        shutil.copytree('resources', '%s/resources' % output_directory)
    else:
        log.info('No resources to copy')

    # render template
    template_filename = '%s/index.html' % deck.presentation_type
    html = render_template(template_filename, deck.json)

    # write index to output directory
    index_filename = '%s/index.html' % output_directory
    write_file(index_filename, html)

    return output_directory
508453
private function setOutputDirectory()
    {
        $outputDirectory = $this->config->get('outputDir');

        //Try to create output dir if non existing
        if (is_dir($outputDirectory) == false) {
            if (mkdir($outputDirectory, 0777, true) == false) {
                throw new Exception('Could not create output directory and it does not exist!');
            }
        }

        $this->dir = $outputDirectory;
    }
260623
public void generateDataUriCss(String dir) throws IOException {
		final String path = (dir == null) ? "" : dir + "/";
		final PrintWriter out = new PrintWriter(path + "DataUriCss.html");

		try {
			out.append("<html>\n<head>\n\t<style>");

			for (OptimizerResult result : results) {
				final String name = result.fileName.replaceAll("[^A-Za-z0-9]", "_");
				out.append('#').append(name).append(" {\n")
						.append("\tbackground: url(\"data:image/png;base64,")
						.append(result.dataUri).append("\") no-repeat left top;\n")
						.append("\twidth: ").append(String.valueOf(result.width)).append("px;\n")
						.append("\theight: ").append(String.valueOf(result.height)).append("px;\n")
						.append("}\n");
			}
			out.append("\t</style>\n</head>\n<body>\n");

			for (OptimizerResult result : results) {
				final String name = result.fileName.replaceAll("[^A-Za-z0-9]", "_");
				out.append("\t<div id=\"").append(name).append("\"></div>\n");
			}

			out.append("</body>\n</html>");
		} finally {
			if (out != null) {
				out.close();
			}
		}
	}
409262
public static void dump(final Delta delta, final PrintStream out) {
        final List<Difference> sortedDifferences = new LinkedList<Difference>(delta.getDifferences());
        Collections.sort(sortedDifferences);
        dump(sortedDifferences, out);
    }
288861
public function createOutputDir()
    {
        $outputDir = $this->configuration->get('output');

        if (!is_writable($outputDir)) {
            @mkdir($outputDir, 0777, true);

            if (!is_writable($outputDir)) {
                throw new \RuntimeException("Output directory {$outputDir} is not writable.");
            }
        }
    }
871826
def render_html(data_dir, output_dir):
    
    env = Environment(loader=PackageLoader('pa11ycrawler', 'templates'))
    env.globals["wcag_refs"] = wcag_refs
    pages = []
    counter = collections.Counter()
    grouped_violations = collections.defaultdict(dict)

    # render detail templates
    for data_file in data_dir.files('*.json'):
        data = json.load(data_file.open())
        num_error, num_warning, num_notice = pa11y_counts(data['pa11y'])

        data["num_error"] = num_error
        data["num_warning"] = num_warning
        data["num_notice"] = num_notice
        fname = data_file.namebase + ".html"
        html_path = output_dir / fname
        render_template(env, html_path, 'detail.html', data)

        data["filename"] = fname
        pages.append(data)

        for violation in data['pa11y']:
            violation_id = hashlib.md5(
                (violation['selector'] + violation['code']).encode('utf-8')
            ).hexdigest()

            if violation_id not in grouped_violations[violation['type']]:
                violation['pages'] = []
                grouped_violations[violation['type']][violation_id] = violation
                counter[violation['type']] += 1

            grouped_violations[violation['type']][violation_id]['pages'].append({
                'url': data['url'],
                'page_title': data['page_title']
            })

    def extract_nums(page):
        "Used to sort pages by violation counts"
        return (
            page["num_error"],
            page["num_warning"],
            page["num_notice"],
        )

    index_path = output_dir / INDEX_TEMPLATE
    render_template(env, index_path, INDEX_TEMPLATE, {
        "pages": sorted(pages, key=extract_nums, reverse=True),
        "num_error": counter["error"],
        "num_warning": counter["warning"],
        "num_notice": counter["notice"]
    })

    for violation_type in grouped_violations:
        unique_path = output_dir / u'{}s.html'.format(violation_type)
        render_template(env, unique_path, UNIQUE_TEMPLATE, {
            "grouped_violations": sorted(
                grouped_violations[violation_type].values(),
                key=lambda item: len(item['pages']),
                reverse=True
            ),
            "current_type": violation_type,
            "violation_counts": counter
        })