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

Do not check S3 URL paths #106

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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