Java Code Examples for htsjdk.samtools.util.IOUtil#assertDirectoryIsReadable()

The following examples show how to use htsjdk.samtools.util.IOUtil#assertDirectoryIsReadable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CheckIlluminaDirectory.java    From picard with MIT License 6 votes vote down vote up
@Override
protected String[] customCommandLineValidation() {
    IOUtil.assertDirectoryIsReadable(BASECALLS_DIR);
    final List<String> errors = new ArrayList<>();

    for (final Integer lane : LANES) {
        if (lane < 1) {
            errors.add(
                    "LANES must be greater than or equal to 1.  LANES passed in " + StringUtil.join(", ", LANES));
            break;
        }
    }

    if (errors.isEmpty()) {
        return null;
    } else {
        return errors.toArray(new String[errors.size()]);
    }
}
 
Example 2
Source File: ParameterizedFileUtil.java    From picard with MIT License 5 votes vote down vote up
protected File getRunFile(final File baseDirectory, final Pattern pattern) {
    if (baseDirectory.exists()) {
        IOUtil.assertDirectoryIsReadable(baseDirectory);
        final File[] files = IOUtil.getFilesMatchingRegexp(baseDirectory, pattern);
        if (files.length == 1) {
            return files[0];
        }
    }
    return null;
}
 
Example 3
Source File: ParameterizedFileUtil.java    From picard with MIT License 5 votes vote down vote up
/**
 * Return all files that match pattern of the given file type in the given base directory
 */
protected IlluminaFileMap getTiledFiles(final File baseDirectory, final Pattern pattern) {
    final IlluminaFileMap fileMap = new IlluminaFileMap();
    if (baseDirectory.exists()) {
        IOUtil.assertDirectoryIsReadable(baseDirectory);
        final File[] files = IOUtil.getFilesMatchingRegexp(baseDirectory, pattern);
        for (final File file : files) {
            if (!skipEmptyFiles || file.length() > 0) {
                fileMap.put(fileToTile(file.getName()), file);
            }
        }
    }

    return fileMap;
}