Skip to content

Commit

Permalink
remove extraneous debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Jan 26, 2024
1 parent 55aaa11 commit 3c9a552
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
4 changes: 2 additions & 2 deletions main.path.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
nextflow.enable.dsl=2

test_file_local = 'README.md'
test_file_s3 = 's3://quilt-example/examples/protein-paint/README.md'
test_file_quilt = 'quilt+s3://quilt-example#package=examples/protein-paint&path=README.md'
test_file_s3 = 's3://quilt-example/examples/hurdat2/README.md'
test_file_quilt = 'quilt+s3://quilt-example#package=examples/hurdat2&path=README.md'

myFileChannel = Channel.fromList([file(test_file_local), file(test_file_s3), file(test_file_quilt)])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import java.nio.file.LinkOption
import java.nio.file.NoSuchFileException
import java.nio.file.OpenOption
import java.nio.file.Path
import java.nio.file.Paths
import java.nio.file.StandardOpenOption
import java.nio.file.attribute.BasicFileAttributeView
import java.nio.file.attribute.BasicFileAttributes
Expand All @@ -48,7 +47,6 @@ import groovy.util.logging.Slf4j
import nextflow.Global
import nextflow.Session
import nextflow.quilt.jep.QuiltParser
import nextflow.quilt.jep.QuiltPackage
import nextflow.file.FileSystemTransferAware
import nextflow.file.CopyOptions
import nextflow.file.FileHelper
Expand All @@ -68,15 +66,12 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
private Map<Path,BasicFileAttributes> attributesCache = [:]

static QuiltPath asQuiltPath(Path path) {
println("asQuiltPath.path: ${path}")
if (path in QuiltPath) {
return (QuiltPath)path
}
String pathString = path?.toString() ?: '-'
println("asQuiltPath.pathString: ${pathString}")
if (pathString.startsWith(QuiltParser.SCHEME + ':/')) {
QuiltPath qPath = QuiltPathFactory.parse(pathString)
println("asQuiltPath.qPath: ${qPath}")
return qPath
}
String pathClassName = path?.class?.name ?: '-'
Expand Down Expand Up @@ -116,16 +111,7 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
void download(Path remoteFile, Path localDestination, CopyOption... options) throws IOException {
log.debug "QuiltFileSystemProvider.download: ${remoteFile} -> ${localDestination}"
QuiltPath qPath = asQuiltPath(remoteFile)
println("QuiltFileSystemProvider.qPath: ${qPath}")
Path proxy = qPath.localPath()
println("QuiltFileSystemProvider.proxy: ${proxy}")
QuiltPackage pkg = qPath.pkg()
println("QuiltFileSystemProvider.pkg[installed=${pkg.installed}]: ${pkg}")
/*QuiltPackage pkg = qPath.pkg()
String pathName = pkg.parsed.getPath()
Path localFolder = localDestination.getParent()
Path actualDestination = Paths.get(localFolder.toUriString(), pathName)
log.debug "QuiltFileSystemProvider.actualDestination: ${actualDestination}"*/

final CopyOptions opts = CopyOptions.parse(options)
// delete target if it exists and REPLACE_EXISTING is specified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,12 @@ class QuiltPathFactory extends FileSystemPathFactory {

@Override
protected Path parseUri(String uriString) {
println('parseUri.uriString: ' + uriString)
if (!uriString.startsWith(QuiltParser.SCHEME)) {
return null
}
String[] split = uriString.split('/')
println('parseUri.split: ' + split)
String newString = (split[1] == '') ? uriString : uriString.replaceFirst(/\/+/, '//')
println('parseUri.newString: ' + newString)
final uri = new URI(newString)
println('parseUri.uri: ' + uri)
return FileHelper.getOrCreateFileSystemFor(uri).provider().getPath(uri)
}

Expand Down

0 comments on commit 3c9a552

Please sign in to comment.