Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 42a4a03

Browse files
authored
Merge pull request #106 from mirpedrol/more-s3
Do not check S3 URL paths
2 parents 24df409 + 3ed83fd commit 42a4a03

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Bug fixes
66

7+
- Do not check S3 URL paths with `PathValidator` `FilePathValidator` and `DirectoryPathValidator` ([#106](https://github.com/nextflow-io/nf-validation/pull/106))
78
- Make monochrome_logs an option in `paramsSummaryLog()`, `paramsSummaryMap()` and `paramsHelp()` instead of a global parameter ([#101](https://github.com/nextflow-io/nf-validation/pull/101))
89

910
# Version 0.3.3

plugins/nf-validation/src/main/nextflow/validation/FormatValidators/DirectoryPathValidator.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
package nextflow.validation
22

33
import java.nio.file.Path
4+
import groovy.util.logging.Slf4j
45

56
import org.everit.json.schema.FormatValidator
67
import nextflow.Nextflow
78

9+
@Slf4j
810
public class DirectoryPathValidator implements FormatValidator {
911

1012
@Override
1113
public Optional<String> validate(final String subject) {
14+
if (subject.startsWith('s3://')) {
15+
log.debug("S3 paths are not supported by 'DirectoryPathValidator': '${subject}'")
16+
return Optional.empty()
17+
}
1218
Path file = Nextflow.file(subject) as Path
1319
if (file.exists() && !file.isDirectory()) {
1420
return Optional.of("'${subject}' is not a directory, but a file" as String)

plugins/nf-validation/src/main/nextflow/validation/FormatValidators/FilePathValidator.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
package nextflow.validation
22

33
import java.nio.file.Path
4+
import groovy.util.logging.Slf4j
45

56
import org.everit.json.schema.FormatValidator
67
import nextflow.Nextflow
78

9+
@Slf4j
810
public class FilePathValidator implements FormatValidator {
911

1012
@Override
1113
public Optional<String> validate(final String subject) {
14+
if (subject.startsWith('s3://')) {
15+
log.debug("S3 paths are not supported by 'FilePathValidator': '${subject}'")
16+
return Optional.empty()
17+
}
1218
Path file = Nextflow.file(subject) as Path
1319
if (file.isDirectory()) {
1420
return Optional.of("'${subject}' is not a file, but a directory" as String)

plugins/nf-validation/src/main/nextflow/validation/FormatValidators/PathValidator.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
package nextflow.validation
22

33
import java.nio.file.Path
4+
import groovy.util.logging.Slf4j
45

56
import org.everit.json.schema.FormatValidator
67
import nextflow.Nextflow
78

9+
@Slf4j
810
public class PathValidator implements FormatValidator {
911

1012
@Override
1113
public Optional<String> validate(final String subject) {
14+
if (subject.startsWith('s3://')) {
15+
log.debug("S3 paths are not supported by 'PathValidator': '${subject}'")
16+
return Optional.empty()
17+
}
1218
Path file = Nextflow.file(subject) as Path
1319
return Optional.empty()
1420
}

0 commit comments

Comments
 (0)