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

Commit

Permalink
Merge pull request #106 from mirpedrol/more-s3
Browse files Browse the repository at this point in the history
Do not check S3 URL paths
  • Loading branch information
ewels committed Oct 10, 2023
2 parents 24df409 + 3ed83fd commit 42a4a03
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug fixes

- Do not check S3 URL paths with `PathValidator` `FilePathValidator` and `DirectoryPathValidator` ([#106](https://github.com/nextflow-io/nf-validation/pull/106))
- 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))

# Version 0.3.3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package nextflow.validation

import java.nio.file.Path
import groovy.util.logging.Slf4j

import org.everit.json.schema.FormatValidator
import nextflow.Nextflow

@Slf4j
public class DirectoryPathValidator implements FormatValidator {

@Override
public Optional<String> validate(final String subject) {
if (subject.startsWith('s3://')) {
log.debug("S3 paths are not supported by 'DirectoryPathValidator': '${subject}'")
return Optional.empty()
}
Path file = Nextflow.file(subject) as Path
if (file.exists() && !file.isDirectory()) {
return Optional.of("'${subject}' is not a directory, but a file" as String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package nextflow.validation

import java.nio.file.Path
import groovy.util.logging.Slf4j

import org.everit.json.schema.FormatValidator
import nextflow.Nextflow

@Slf4j
public class FilePathValidator implements FormatValidator {

@Override
public Optional<String> validate(final String subject) {
if (subject.startsWith('s3://')) {
log.debug("S3 paths are not supported by 'FilePathValidator': '${subject}'")
return Optional.empty()
}
Path file = Nextflow.file(subject) as Path
if (file.isDirectory()) {
return Optional.of("'${subject}' is not a file, but a directory" as String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package nextflow.validation

import java.nio.file.Path
import groovy.util.logging.Slf4j

import org.everit.json.schema.FormatValidator
import nextflow.Nextflow

@Slf4j
public class PathValidator implements FormatValidator {

@Override
public Optional<String> validate(final String subject) {
if (subject.startsWith('s3://')) {
log.debug("S3 paths are not supported by 'PathValidator': '${subject}'")
return Optional.empty()
}
Path file = Nextflow.file(subject) as Path
return Optional.empty()
}
Expand Down

0 comments on commit 42a4a03

Please sign in to comment.