From af5e3e7be44738058394669a5ab41cf05d3ec746 Mon Sep 17 00:00:00 2001 From: labkey-matthewb Date: Thu, 29 Oct 2026 12:45:59 -0700 Subject: [PATCH] Resolve SequenceAnalysis pipeline paths through PipeRoot new Path(form.getPath()) treats a multi-segment path as one name, which platform fb_docker_tar now rejects; also handles supplemental roots and missing paths. --- .../SequenceAnalysisController.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java b/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java index 638f77fcf..10cd3e274 100644 --- a/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java +++ b/SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java @@ -1073,7 +1073,13 @@ public ApiResponse execute(ValidateReadsetImportForm form, BindException errors) FileLike base = root.getRootFileLike(); if (form.getPath() != null) - base = base.resolveFile(new Path(form.getPath())); + { + base = root.resolvePathToFileLike(form.getPath()); + if (null == base) + { + throw new PipelineJobException("Invalid path: " + form.getPath()); + } + } for (String fileName : form.getFileNames()) { @@ -1088,7 +1094,7 @@ public ApiResponse execute(ValidateReadsetImportForm form, BindException errors) Map map = new HashMap<>(); map.put("fileName", fileName); map.put("filePath", f.getPath()); - map.put("relPath", FileUtil.relativePath(FileUtil.getAbsoluteCaseSensitiveFile(FileSystemLike.toFile(root.getRootFileLike())).getPath(), FileUtil.getAbsoluteCaseSensitiveFile(f).getPath())); + map.put("relPath", root.relativePath(f)); map.put("container", getContainer().getId()); map.put("containerPath", getContainer().getPath()); String basename = SequenceTaskHelper.getUnzippedBaseName(fileName); @@ -1925,12 +1931,13 @@ else if (!d.getContainer().hasPermission(u, ReadPermission.class)) else if (o.has("relPath") || o.has("fileName")) { FileLike f; - if (o.opt("relPath") == null) + if (o.isNull("relPath")) { - if (path != null) + if (StringUtils.isNotEmpty(path)) { f = pr.resolvePathToFileLike(path); - f = f.resolveFile(Path.parse(o.getString("fileName"))); + if (f != null) + f = f.resolveFile(Path.parse(o.getString("fileName"))); } else { @@ -2231,7 +2238,12 @@ public Object execute(ImportFastaSequencesForm form, BindException errors) throw return null; } - FileLike baseDir = StringUtils.trimToNull(form.getPath()) == null ? root.getRootFileLike() : root.getRootFileLike().resolveFile(new Path(form.getPath())); + FileLike baseDir = StringUtils.trimToNull(form.getPath()) == null ? root.getRootFileLike() : root.resolvePathToFileLike(form.getPath()); + if (baseDir == null) + { + errors.reject(ERROR_MSG, "Invalid path: " + form.getPath()); + return null; + } if (!baseDir.exists()) {