Create the index file that sets up the frameset.
@param outputDirectory The target directory for the generated file(s).
510480
private void createFrameset(File outputDirectory) throws Exception
    {
        VelocityContext context = createContext();
        generateFile(new File(outputDirectory, INDEX_FILE),
                     INDEX_FILE + TEMPLATE_EXTENSION,
                     context);
    }
529284
private static IndexEnvironment setupIndexer(File outputDirectory, int memory,
      boolean storeDocs) throws Exception {
    final IndexEnvironment env = new IndexEnvironment();
    env.setMemory(memory * ONE_MEGABYTE);
    final Specification spec = env.getFileClassSpec("trectext");
    env.addFileClass(spec);
    env.setStoreDocs(storeDocs);
    // if we don't build indices on DOCNO then getting the docIds at query time is
    // extremely slow
    env.setMetadataIndexedFields(new String[]{"docno"}, new String[]{"docno"});
    env.create(outputDirectory.getAbsolutePath(), statusMonitor);
    return env;
  }
834758
public static void setOutputPath(Job job, Path outputDir) {
    job.getConfiguration().set("mapred.output.dir", outputDir.toString());
  }
584235
protected OutputStream createOutputStream (File target)
        throws IOException
    {
        // make sure the parent directory exists
        target.getParentFile().mkdirs();
        // now create our file
        JarOutputStream jout = new JarOutputStream(new FileOutputStream(target));
        jout.setLevel(uncompressed() ? Deflater.NO_COMPRESSION : Deflater.BEST_COMPRESSION);
        return jout;
    }
662635
public void setTargetDirectory(String directory) {
        if (directory != null && directory.length() > 0) {
            this.targetDirectory = new File(directory);
        } else {
            this.targetDirectory = null;
        }
    }
218537
protected function prepareWritableDirectories($appDirectory, OutputInterface $output)
    {
        $filesystem = new Filesystem;

        try {
            $filesystem->chmod($appDirectory.DIRECTORY_SEPARATOR.'bootstrap/cache', 0755, 0000, true);
            $filesystem->chmod($appDirectory.DIRECTORY_SEPARATOR.'storage', 0755, 0000, true);
        } catch (IOExceptionInterface $e) {
            $output->writeln('<comment>You should verify that the "storage" and "bootstrap/cache" directories are writable.</comment>');
        }

        return $this;
    }
17919
private File validateOutputDirectory(File outputDirectory) {
        // Create output directory
        if (!outputDirectory.mkdir() && !outputDirectory.exists()) {
            throw new ArchiveExportException("Unable to create archive output directory - " + outputDirectory);
        }
        if (outputDirectory.isFile()) {
            throw new IllegalArgumentException("Unable to export exploded directory to "
                + outputDirectory.getAbsolutePath() + ", it points to a existing file");
        }

        return outputDirectory;
    }
404316
public void create(String outputdir, Program program) {
		types.stream().forEach((type) -> type.createOutput(outputdir, program));
	}
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);
    }
1354521
private void createOutputFile() throws IOException {
        this.fileChannel = Files.newByteChannel(Paths.get(filePath), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
    }
452202
private void markOutputDirSuccessful(JobContext context)
  throws IOException {
    if (outputPath != null) {
      FileSystem fileSys = outputPath.getFileSystem(context.getConfiguration());
      if (fileSys.exists(outputPath)) {
        // create a file in the folder to mark it
        Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);
        fileSys.create(filePath).close();
      }
    }
  }
303649
public Processor setOutputDir(final URI output) {
        if (!output.isAbsolute()) {
            throw new IllegalArgumentException("Output directory URI must be absolute: " + output);
        }
        if (!output.getScheme().equals("file")) {
            throw new IllegalArgumentException("Only file scheme allowed as output directory URI: " + output);
        }
        args.put("output.dir", output.toString());
        return this;
    }
233103
public function setOutputDirectory(PhingFile $out)
    {
        if (!$out->exists()) {
            $out->mkdirs();
        }
        $this->outDir = $out;
    }
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.");
		}
	}
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.");
            }
        }
    }
660567
private void processOutputDirectory() {
        final String root = outputDirectory.getAbsolutePath();
        final String leaf = PhaseOneApplication.DIR_ARTIFACT;
        final String path = asPath(root, leaf);
        final File phaseIPath = new File(path);

        // Fail if the working path doesn't contain a phase I artifact
        if (!phaseIPath.isDirectory()) {
            error(NOT_A_PHASE1_DIR + ": " + phaseIPath);
            failUsage();
        }

        // Fail if the working path doesn't contain any proto-networks
        final File[] networks = phaseIPath.listFiles(new ProtonetworkFilter());
        if (networks.length == 0) {
            error(NO_PROTO_NETWORKS + " found in " + phaseIPath);
            failUsage();
        }

        // Create the directory artifact or fail
        artifactPath = createDirectoryArtifact(outputDirectory, DIR_ARTIFACT);

        processDirectories(networks);
    }
716265
private static void createSimpleProject( File targetDirectory, CreationBean creationBean )
	throws IOException {

		// Create the directory structure
		String[] directoriesToCreate = creationBean.isReusableRecipe() ? RR_DIRECTORIES : ALL_DIRECTORIES;
		for( String s : directoriesToCreate ) {
			File dir = new File( targetDirectory, s );
			Utils.createDirectory( dir );
		}

		// Create the descriptor
		InputStream in = ProjectUtils.class.getResourceAsStream( "/application-skeleton.props" );
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		Utils.copyStreamSafely( in, out );
		String tpl = out.toString( "UTF-8" )
				.replace( TPL_NAME, creationBean.getProjectName())
				.replace( TPL_VERSION, creationBean.getProjectVersion())
				.replace( TPL_DESCRIPTION, creationBean.getProjectDescription());

		// Create the rest of the project
		completeProjectCreation( targetDirectory, tpl, creationBean );
	}