Skip to content

Commit

Permalink
Add validation of existence of input directories (#1673)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbggrant committed Apr 28, 2021
1 parent 0fd4218 commit b675e57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/picard/illumina/IlluminaBasecallsToFastq.java
Expand Up @@ -226,6 +226,11 @@ protected int doWork() {
protected String[] customCommandLineValidation() {
final LinkedList<String> errors = new LinkedList<>();

IOUtil.assertDirectoryIsReadable(BASECALLS_DIR);
if (BARCODES_DIR != null) {
IOUtil.assertDirectoryIsReadable(BARCODES_DIR);
}

if (NUM_PROCESSORS == 0) {
NUM_PROCESSORS = Runtime.getRuntime().availableProcessors();
} else if (NUM_PROCESSORS < 0) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/picard/illumina/IlluminaBasecallsToSam.java
Expand Up @@ -275,6 +275,10 @@ protected int doWork() {
* Prepares loggers, initiates garbage collection thread, parses arguments and initialized variables appropriately/
*/
private void initialize() {
IOUtil.assertDirectoryIsReadable(BASECALLS_DIR);
if (BARCODES_DIR != null) {
IOUtil.assertDirectoryIsReadable(BARCODES_DIR);
}
if (OUTPUT != null) {
IOUtil.assertFileIsWritable(OUTPUT);
}
Expand Down

0 comments on commit b675e57

Please sign in to comment.