Convert the given Class to an HTML.

@param cd the class to convert.
@param outputdir the name of the directory to output to.
552555
public void convertClass(ClassDoc cd, DocPath outputdir) {
        if (cd == null) {
            return;
        }
        try {
            SourcePosition sp = cd.position();
            if (sp == null)
                return;
            Reader r;
            // temp hack until we can update SourcePosition API.
            if (sp instanceof com.sun.tools.javadoc.SourcePositionImpl) {
                FileObject fo = ((com.sun.tools.javadoc.SourcePositionImpl) sp).fileObject();
                if (fo == null)
                    return;
                r = fo.openReader(true);
            } else {
                File file = sp.file();
                if (file == null)
                    return;
                r = new FileReader(file);
            }
            LineNumberReader reader = new LineNumberReader(r);
            int lineno = 1;
            String line;
            relativePath = DocPaths.SOURCE_OUTPUT
                    .resolve(DocPath.forPackage(cd))
                    .invert();
            Content body = getHeader();
            Content pre = new HtmlTree(HtmlTag.PRE);
            try {
                while ((line = reader.readLine()) != null) {
                    addLineNo(pre, lineno);
                    addLine(pre, line, lineno);
                    lineno++;
                }
            } finally {
                reader.close();
            }
            addBlankLines(pre);
            Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
            body.addContent(div);
            writeToFile(body, outputdir.resolve(DocPath.forClass(cd)));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
1275463
private static void copyAllJars(String outputDir) throws IOException
   {
      File out = new File(outputDir);
      String targetPath = out.getAbsolutePath() + File.separatorChar + "lib";

      File current = new File(".");
      String path = current.getCanonicalPath();

      String libPath = path + File.separatorChar + ".." + File.separatorChar +
            ".." + File.separatorChar + "lib";
      Utils.copyFolder(libPath, targetPath, "jar", false);

   }
255215
protected void writeHtml(final MBasicTable table, final OutputStream outputStream,
			final boolean isSelection) throws IOException {
		final Writer out = new OutputStreamWriter(outputStream, "UTF-8");

		final String eol = isSelection ? "\n" : System.getProperty("line.separator");
		// eol = "\n" si sélection, "\r\n" sinon pour un fichier windows et "\n" pour un fichier unix

		out.write("<!-- Fichier genere par ");
		out.write(System.getProperty("user.name"));
		out.write(" le ");
		out.write(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG)
				.format(new Date()));
		out.write(" -->");
		out.write(eol);

		out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
		out.write("<html>");
		out.write(eol);
		final String title = buildTitle(table);
		writeHtmlHead(title, out, eol);
		out.write("<body>");
		out.write(eol);
		if (title != null) {
			out.write("<h3>");
			out.write(title);
			out.write("</h3>");
		}
		out.write(eol);

		writeHtmlTable(table, isSelection, out, eol);
		out.write("</body>");
		out.write(eol);
		out.write("</html>");
		out.flush();
	}
1070251
function output(string) {
    var element = document.createElement("div")
    element.innerHTML = string
    outputElement.appendChild(element)
}
986910
private static void outputHelp() {
        System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>");
        System.out.println("where options include:");
        System.out.println("   -srcdir <directory>   Where to find source directories (required)");
        System.out.println("   -dstdir <directory>   Where to output generated files (default srcdir)");
        System.out.println("   -version <version>    Specify the version, such as 2009a (optional)");
        System.out.println("   -unpacked             Generate dat files without jar files");
        System.out.println("   -help                 Print this usage message");
        System.out.println("   -verbose              Output verbose information during compilation");
        System.out.println(" There must be one directory for each version in srcdir");
        System.out.println(" Each directory must have the name of the version, such as 2009a");
        System.out.println(" Each directory must contain the unpacked tzdb files, such as asia or europe");
        System.out.println(" Directories must match the regex [12][0-9][0-9][0-9][A-Za-z0-9._-]+");
        System.out.println(" There will be one jar file for each version and one combined jar in dstdir");
        System.out.println(" If the version is specified, only that version is processed");
    }
845996
void generatePackageInfo(Definition def, String outputDir, String subDir)
   {
      try
      {
         FileWriter fw;
         PackageInfoGen phGen;
         if (outputDir.equals("test"))
         {
            fw = Utils.createTestFile("package-info.java", def.getRaPackage(), def.getOutputDir());
            phGen = new PackageInfoGen();

         }
         else
         {

            if (subDir == null)
            {
               fw = Utils.createSrcFile("package-info.java", def.getRaPackage(), def.getOutputDir());
               phGen = new PackageInfoGen();
            }
            else
            {
               fw = Utils.createSrcFile("package-info.java", def.getRaPackage() + "." + subDir, def.getOutputDir());
               phGen = new PackageInfoGen(subDir);
            }
         }
         phGen.generate(def, fw);
         fw.close();
      }
      catch (IOException ioe)
      {
         ioe.printStackTrace();
      }
   }
563759
def _write_to_filepath(content, output):
    
    outdir = os.path.dirname(output)
    if outdir and not os.path.exists(outdir):
        os.makedirs(outdir)

    with anytemplate.compat.copen(output, 'w') as out:
        out.write(content)
214932
public void prettyPrintsReport(File sessionDir, File prettyPrintReportFile)
            throws Exception {
        if ((!sessionDir.exists()) || (!sessionDir.isDirectory())) {
            throw new Exception("Error: LOGDIR " + sessionDir.getAbsolutePath()
                    + " seems not a valid directory. ");
        }
        File xml_logs_report_file = new File(sessionDir.getAbsolutePath()
                + File.separator + "report_logs.xml");
        if (!xml_logs_report_file.exists()) {
            // throw new Exception("Error: missing logfile  " +
            // xml_logs_report_file.getAbsolutePath() + " ! ");
            System.out.println("Warning: missing logfile  "
                    + xml_logs_report_file.getAbsolutePath() + " ! ");
            System.out.println("Trying to create it!");
            LogUtils.createFullReportLog(sessionDir.getAbsolutePath());
        }
        File html_output_report_file = prettyPrintReportFile;
        if (html_output_report_file.exists()) {
            System.out.println("Report file \""
                    + html_output_report_file.getAbsolutePath() + "\" reused!");
            return;
        }
        // Fortify Mod: Close the FileOutputStream and releaase its resources
        // prettyprint(xml_logs_report_file.toURI().toURL().toExternalForm(),
        //         new FileOutputStream(html_output_report_file));
        FileOutputStream fos = new FileOutputStream(html_output_report_file);
        prettyprint(xml_logs_report_file.toURI().toURL().toExternalForm(), fos);
        fos.close();
        System.out.println("Report file \""
                + html_output_report_file.getAbsolutePath() + "\" created!");
    }
911491
public void writeHtmlHead(Writer out)
         throws IOException
    {
        if (!writtenHtmlHead)
        {
            writtenHtmlHead=true;
            completeSections();
            out.write("<html><head>");
            String title=(String)properties.get(Title);
            if (title!=null && title.length()>0 && !title.equals(NoTitle))
                out.write("<title>"+title+"</title>");
            head.write(out);
            out.write(base);
            out.write("\n</head>\n");
        }
    }
276510
public function setOutputDirectory(PhingFile $outputDirectory)
    {
        try {
            if (!$outputDirectory->exists()) {
                $this->log("Output directory does not exist, creating: " . $outputDirectory->getPath(), Project::MSG_VERBOSE);
                if (!$outputDirectory->mkdirs()) {
                    throw new IOException("Unable to create Output directory: " . $outputDirectory->getAbsolutePath());
                }
            }
            $this->outputDirectory = $outputDirectory->getCanonicalPath();
        } catch (IOException $ioe) {
            throw new BuildException($ioe);
        }
    }
85154
function (patternFolder, files, cb) {
    var file, patterns = [];
    files.forEach(function readPattern(pattern) {
      file = {filename: pattern};
      file.content = grunt.file.read(patternFolder + '/' + file.filename);
      patterns.push(file);
    });

    // call the outputPatterns function that generates
    // the html for every pattern
    outputPatterns(patternFolder, patterns, cb);
  }
581038
function( editor, output )
	{
		var id = this.id;

		output.push(
			'<div class="', editor.skinClass ,'"' +
				' lang="', editor.langCode, '"' +
				' role="presentation"' +
				// iframe loading need sometime, keep the panel hidden(#4186).
				' style="display:none;z-index:' + ( editor.config.baseFloatZIndex + 1 ) + '">' +
				'<div' +
					' id=', id,
					' dir=', editor.lang.dir,
					' role="presentation"' +
					' class="cke_panel cke_', editor.lang.dir );

		if ( this.className )
			output.push( ' ', this.className );

		output.push(
				'">' );

		if ( this.forceIFrame || this.css.length )
		{
			output.push(
						'<iframe id="', id, '_frame"' +
							' frameborder="0"' +
							' role="application" src="javascript:void(' );

			output.push(
							// Support for custom document.domain in IE.
							CKEDITOR.env.isCustomDomain() ?
								'(function(){' +
									'document.open();' +
									'document.domain=\'' + document.domain + '\';' +
									'document.close();' +
								'})()'
							:
								'0' );

			output.push(
						')"></iframe>' );
		}

		output.push(
				'</div>' +
			'</div>' );

		return id;
	}
221013
public static void writeAnalysisHTMLToFile(String outputPath, DataAnalysis dataAnalysis, JavaSparkContext sc) {
        try {
            String analysisAsHtml = HtmlAnalysis.createHtmlAnalysisString(dataAnalysis);
            writeStringToFile(outputPath, analysisAsHtml, sc);
        } catch (Exception e) {
            throw new RuntimeException("Error generating or writing HTML analysis file (normalized data)", e);
        }
    }
315638
protected final File createDirectoryArtifact(final File outputDirectory,
            final String artifact) {
        // Construct artifact path based on output directory
        String path = asPath(outputDirectory.getAbsolutePath(), artifact);
        final File ret = new File(path);
        if (!ret.isDirectory()) {
            // Fail if the directory artifact couldn't be created
            if (!ret.mkdir()) {
                error(DIRECTORY_CREATION_FAILED + ret);
                bail(ExitCode.BAD_OUTPUT_DIRECTORY);
            }
        }
        return ret;
    }
691318
protected function makeOutputDirectory()
	{
		if (file_exists($this->outputPath)) {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Main output directory already created (' . $this->outputPath . ')</info>');
			}
		} else {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Making main output directory (' . $this->outputPath . ')</info>');
			}
			mkdir($this->outputPath, 0755, true);
		}

		$managersDirectoryPath = $this->outputPath . DIRECTORY_SEPARATOR . "Managers";
		if (file_exists($managersDirectoryPath)) {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Managers output directory already created (' . $managersDirectoryPath . ')</info>');
			}
		} else {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Making managers output directory (' . $managersDirectoryPath . ')</info>');
			}
			mkdir($managersDirectoryPath, 0755, true);
		}

		$resourcesDirectoryPath = $this->outputPath . DIRECTORY_SEPARATOR . "Resources";
		if (file_exists($resourcesDirectoryPath)) {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Resources output directory already created (' . $resourcesDirectoryPath . ')</info>');
			}
		} else {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Making resources output directory (' . $resourcesDirectoryPath . ')</info>');
			}
			mkdir($resourcesDirectoryPath, 0755, true);
		}

		/*
		$responsesDirectoryPath = $this->outputPath . DIRECTORY_SEPARATOR . "Responses";
		if (file_exists($responsesDirectoryPath)) {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Responses output directory already created (' . $responsesDirectoryPath . ')</info>');
			}
		} else {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Making responses output directory (' . $responsesDirectoryPath . ')</info>');
			}
			mkdir($responsesDirectoryPath ,0755, true);
		}
		*/

		$exceptionsDirectoryPath = $this->outputPath . DIRECTORY_SEPARATOR . "Exceptions";
		if (file_exists($exceptionsDirectoryPath)) {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Exceptions output directory already created (' . $exceptionsDirectoryPath . ')</info>');
			}
		} else {
			if (!is_null($this->outputInterface)) {
				$this->outputInterface->writeln('<info>Making exceptions output directory (' . $exceptionsDirectoryPath . ')</info>');
			}
			mkdir($exceptionsDirectoryPath, 0755, true);
		}
	}
808320
function getOutputFile(file, outputDir) {
  const fileName = path.basename(file).replace('.scss', '.css');
  return path.join(outputDir, fileName);
}
536155
def create_output_directory(cls, outdir):
        """"""
        cls.PATH = outdir
        try:
            os.mkdir(outdir)
        except FileExistsError:
            pass