Initializes the output directory

@param baseDirectory
@param directoryName
@return
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;
    }
528561
public static FilesIterator<File> getAbsoluteIterator(String baseDir) {
		return new FilesIterator<File>(new File(baseDir), Strategy.FILES);
	}
642216
@Override
  public void createDirectory(Path dir, FileAttribute<?>... attrs) {
    CloudStorageUtil.checkPath(dir);
    CloudStorageUtil.checkNotNullArray(attrs);
  }
40392
public void toFolder(Path outputDirectory) {
        Validate.notNull(outputDirectory, "outputDirectory must not be null");

        context.setOutputPath(outputDirectory);

        applyOverviewDocument()
                .writeToFile(outputDirectory.resolve(context.config.getOverviewDocument()), StandardCharsets.UTF_8);
        applyPathsDocument()
                .writeToFile(outputDirectory.resolve(context.config.getPathsDocument()), StandardCharsets.UTF_8);
        applyDefinitionsDocument()
                .writeToFile(outputDirectory.resolve(context.config.getDefinitionsDocument()), StandardCharsets.UTF_8);
        applySecurityDocument()
                .writeToFile(outputDirectory.resolve(context.config.getSecurityDocument()), StandardCharsets.UTF_8);
    }
907516
protected String findInSourceFolders(File baseDir, String fileName) {
        String answer = findInFolder(baseDir, fileName);
        if (answer == null && baseDir.exists()) {
            answer = findInChildFolders(new File(baseDir, "src/main"), fileName);
            if (answer == null) {
                answer = findInChildFolders(new File(baseDir, "src/test"), fileName);
            }
        }
        return answer;
    }
430863
private static String createTempDirectory(String baseDir, String fileStem) {
        Long nano = new Long(System.nanoTime());
        return baseDir + File.separator + fileStem + nano;
    }
1100850
public void setDirectoryNames(java.util.Collection<String> directoryNames) {
        if (directoryNames == null) {
            this.directoryNames = null;
            return;
        }

        this.directoryNames = new java.util.ArrayList<String>(directoryNames);
    }
735155
public static synchronized void setResourcesDirectory(String directory)
    {
        if (directory == null)
        {
            resourcesDir = Constant.EMPTY_STRING + getSeparator();
        }
        else
        {
            resourcesDir = directory + getSeparator();
        }
        loader = Optional.empty();
    }
1367336
public boolean addWorkingDir(String dirName) {
        if (dirName == null) {
            throw new NullPointerException();
        }
        return addToListInternal(currentWorkingDirectoryList, new File(dirName));
    }
268967
protected void generateReadme(String basename) {
		final Object content = getReadmeFileContent(basename);
		if (content != null) {
			final String textualContent = content.toString();
			if (!Strings.isEmpty(textualContent)) {
				final byte[] bytes = textualContent.getBytes();
				for (final String output : getOutputs()) {
					final File directory = new File(output).getAbsoluteFile();
					try {
						directory.mkdirs();
						final File outputFile = new File(directory, README_BASENAME);
						Files.write(Paths.get(outputFile.getAbsolutePath()), bytes);
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				}
			}
		}
	}
230878
private static File getJdkHomeDir(@Nullable String baseDirectoryPath,
      @Nullable String homeDirPath, String vmConfigName)
          throws InvalidConfigurationException {
    if (homeDirPath == null) {
      File baseDirectory = getBaseDirectory(baseDirectoryPath);
      File homeDir = new File(baseDirectory, vmConfigName);
      checkConfiguration(homeDir.isDirectory(), "%s is not a directory", homeDir);
      return homeDir;
    } else {
      File potentialHomeDir = new File(homeDirPath);
      if (potentialHomeDir.isAbsolute()) {
        checkConfiguration(potentialHomeDir.isDirectory(), "%s is not a directory",
            potentialHomeDir);
        return potentialHomeDir;
      } else {
        File baseDirectory = getBaseDirectory(baseDirectoryPath);
        File homeDir = new File(baseDirectory, homeDirPath);
        checkConfiguration(homeDir.isDirectory(), "%s is not a directory", potentialHomeDir);
        return homeDir;
      }
    }
  }
66724
public static String getRelativePath(File baseDir, File file){
		if(!baseDir.isDirectory()){
			throw new IllegalArgumentException("Base directory must be a directory.");
		}

		String dirPath = FilenameUtils.normalize(baseDir.getAbsolutePath(), true);
		String filePath = FilenameUtils.normalize(file.getAbsolutePath(), true);
		if(!dirPath.endsWith("/")){
			dirPath += "/";
		}

		if(filePath.startsWith(dirPath)){
			return filePath.substring(dirPath.length());
		}else {
			throw new IllegalArgumentException("File '" + file + "' not in base directory '" + baseDir + "'");
		}
	}
448116
public static FilesystemFramework getInstanceWithoutProjectsDir(final String rdeck_base_dir) {
        File baseDir = new File(rdeck_base_dir);
        File propertyFile = getPropertyFile(getConfigDir(baseDir));
        String projectsDir=null;
        if(propertyFile.exists()){
            PropertyRetriever propertyRetriever = FilesystemFramework.createPropertyRetriever(baseDir);
            projectsDir = propertyRetriever.getProperty("framework.projects.dir");
        }
        return new FilesystemFramework(new File(rdeck_base_dir), new File(projectsDir));
    }
53631
def _create_paths(self, basedir, name=None):
        """"""
        if name:
            datapath = os.path.join(basedir, name)
        else:
            datapath = basedir

        dbpath = os.path.join(datapath, 'db')
        if not os.path.exists(dbpath):
            os.makedirs(dbpath)
        if self.args['verbose']:
            print('creating directory: %s' % dbpath)

        return datapath
769320
public static String filterOutputDirectory(String base, String suiteName) {
        logger.entering(new Object[] { base, suiteName });
        int index = base.lastIndexOf(suiteName);
        String outputFolderWithoutName = base.substring(0, index);
        logger.exiting(outputFolderWithoutName + File.separator);
        return outputFolderWithoutName + File.separator;
    }
14415
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;
    }
756282
function (basedir, filefn, dirfn) {
        filefn = filefn || function() {};
        dirfn = dirfn || function() {};

        var readdirSync = function(dir) {
            var files = fs.readdirSync(dir);

            for (var i = 0; i < files.length; i++) {
                var file = dir+'/'+files[i];
                //debug('before fs.statsSync:', file);
                var stats = fs.statSync(file);

                if (stats.isFile()) {
                var prefix = dir.replace(basedir, '');
                    filefn(prefix, dir, files[i], stats);

                } else if (stats.isDirectory()) {
                    var prefix = file.replace(basedir, '');
                    dirfn(prefix, stats);
                    readdirSync(file);

                } else {
                    console.error('error:'.error, 'It is a file type that is not assumed. file:', file);
                    return;
                }
            }
        };
        readdirSync(basedir);
    }