Skip to content

Commit

Permalink
Refactor virtual fs schemes to XPath class
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Dec 11, 2022
1 parent 7bbf140 commit fd59b94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ abstract class XFileSystemProvider extends FileSystemProvider {

private Map<URI, FileSystem> fileSystemMap = new LinkedHashMap<>(20)

static final public Set<String> ALL_SCHEMES = ['ftp','http','https'] as Set

static final public String DEFAULT_RETRY_CODES = '404,410'

static final public int MAX_REDIRECT_HOPS = 5
Expand Down
4 changes: 3 additions & 1 deletion modules/nf-httpfs/src/main/nextflow/file/http/XPath.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import groovy.transform.CompileStatic
@CompileStatic
class XPath implements Path {

static final public Set<String> ALL_SCHEMES = ['ftp','http','https'] as Set

private static final String[] EMPTY = []

private XFileSystem fs
Expand Down Expand Up @@ -295,7 +297,7 @@ class XPath implements Path {

def uri = new URI(null,null,str,null,null)

if( uri.scheme && !XFileSystemProvider.ALL_SCHEMES.contains(uri.scheme))
if( uri.scheme && !ALL_SCHEMES.contains(uri.scheme))
throw new ProviderMismatchException()

uri.authority ? (XPath)Paths.get(uri) : new XPath(null, str)
Expand Down

0 comments on commit fd59b94

Please sign in to comment.