Skip to content

Commit

Permalink
Use proper hurdat2 package (with README)
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Jan 26, 2024
1 parent cb59d97 commit 55aaa11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class QuiltPackage {

manifest.install(dest)
log.debug("done: installed into $dest)")
println("Children: ${relativeChildren('')}")
} catch (IOException e) {
log.error("failed to install $packageName")
// this is non-fatal error, so we don't want to stop the pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,30 @@ 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.download: ${qPath}")
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.download: ${proxy} -> ${actualDestination}"
log.debug "QuiltFileSystemProvider.actualDestination: ${actualDestination}"*/

final CopyOptions opts = CopyOptions.parse(options)
// delete target if it exists and REPLACE_EXISTING is specified
if (opts.replaceExisting()) {
FileHelper.deletePath(actualDestination)
FileHelper.deletePath(localDestination)
}
else if (Files.exists(actualDestination)) {
throw new FileAlreadyExistsException(actualDestination.toString())
else if (Files.exists(localDestination)) {
throw new FileAlreadyExistsException(localDestination.toString())
}

if (!Files.exists(proxy)) {
throw new NoSuchFileException(remoteFile.toString())
}
Files.copy(proxy, actualDestination, options)
Files.copy(proxy, localDestination, options)
}

void upload(Path localFile, Path remoteDestination, CopyOption... options) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class QuiltFileSystemProviderTest extends QuiltSpecification {
given:
QuiltFileSystemProvider provider = new QuiltFileSystemProvider()
String filename = 'README.md'
Path remoteFile = Paths.get('quilt+s3://quilt-example#package=examples%2fhurdat&path=' + filename)
Path remoteFile = Paths.get('quilt+s3://quilt-example#package=examples%2fhurdat2&path=' + filename)
Path tempFolder = Files.createTempDirectory('quilt')
Path tempFile = tempFolder.resolve(filename)

Expand Down

0 comments on commit 55aaa11

Please sign in to comment.