diff --git a/src/org/labkey/targetedms/SkylineDocImporter.java b/src/org/labkey/targetedms/SkylineDocImporter.java index 5e6f30648..004e7fa4d 100644 --- a/src/org/labkey/targetedms/SkylineDocImporter.java +++ b/src/org/labkey/targetedms/SkylineDocImporter.java @@ -71,6 +71,7 @@ import org.labkey.targetedms.query.ReplicateManager; import org.labkey.targetedms.query.RepresentativeStateManager; import org.labkey.targetedms.query.SkylineListManager; +import org.labkey.vfs.FileLike; import javax.xml.stream.XMLStreamException; import java.io.ByteArrayInputStream; @@ -239,17 +240,17 @@ public TargetedMSRun importRun(RunInfo runInfo, PipelineJob job) throws IOExcept try { - File inputFile = getInputFile(); + FileLike inputFile = getInputFile(); if (null == inputFile) throw new FileNotFoundException(); // Set the size of the Skyline document (.sky.zip) file. - run.setDocumentSize(Files.size(inputFile.toPath())); + run.setDocumentSize(inputFile.getSize()); saveRunDocumentSize(run); updateRunStatus(IMPORT_STARTED); _log.info("Starting to import Skyline document from " + run.getFileName()); - importSkylineDoc(run, inputFile); + importSkylineDoc(run, inputFile.toNioPathForRead().toFile()); _log.info("Completed import of Skyline document from " + run.getFileName()); updateRunStatus(IMPORT_SUCCEEDED, STATUS_SUCCESS); @@ -2725,10 +2726,10 @@ private RegressionFit getRegressionFit(QuantificationSettings quantificationSett } @Nullable - private File getInputFile() + private FileLike getInputFile() { if (_expData.hasFileScheme()) - return _expData.getFile(); + return _expData.getFileLike(); if (null == _pipeRoot || null == _localDirectory) return null; diff --git a/src/org/labkey/targetedms/chromlib/ChromatogramLibraryUtils.java b/src/org/labkey/targetedms/chromlib/ChromatogramLibraryUtils.java index b6ebe713e..5a39d9823 100644 --- a/src/org/labkey/targetedms/chromlib/ChromatogramLibraryUtils.java +++ b/src/org/labkey/targetedms/chromlib/ChromatogramLibraryUtils.java @@ -33,6 +33,7 @@ import org.labkey.targetedms.TargetedMSManager; import org.labkey.targetedms.TargetedMSRun; import org.labkey.targetedms.query.ConflictResultsManager; +import org.labkey.vfs.FileLike; import org.sqlite.SQLiteConfig; import java.io.File; @@ -182,14 +183,14 @@ public static Integer parseChromLibRevision(@NotNull String chromLibFileName) return null; } - public static Path getChromLibTempFile(Container container, LocalDirectory localDirectory, int revision) throws IOException + public static FileLike getChromLibTempFile(Container container, LocalDirectory localDirectory, int revision) throws IOException { // Temp file in LocalDirectory (guaranteed to be local File dir) - File localDir = localDirectory.getLocalDirectoryFile(); - Path chromLibDir = localDir.toPath().resolve(CHROM_LIB_FILE_DIR); - if(!Files.exists(chromLibDir)) + FileLike localDir = localDirectory.getLocalDirectoryFile(); + FileLike chromLibDir = localDir.resolveChild(CHROM_LIB_FILE_DIR); + if(!chromLibDir.exists()) FileUtil.createDirectory(chromLibDir); - return chromLibDir.resolve( + return chromLibDir.resolveChild( FileUtil.makeFileNameWithTimestamp(CHROM_LIB_FILE_BASE_NAME+"_"+container.getRowId()+"_rev"+revision, CHROM_LIB_FILE_EXT)); } diff --git a/src/org/labkey/targetedms/chromlib/ContainerChromatogramLibraryWriter.java b/src/org/labkey/targetedms/chromlib/ContainerChromatogramLibraryWriter.java index 7572ce206..f6c69901c 100644 --- a/src/org/labkey/targetedms/chromlib/ContainerChromatogramLibraryWriter.java +++ b/src/org/labkey/targetedms/chromlib/ContainerChromatogramLibraryWriter.java @@ -113,7 +113,7 @@ public ContainerChromatogramLibraryWriter(String panoramaServer, Container conta public String writeLibrary(LocalDirectory localDirectory, int libraryRevision) throws SQLException, IOException { - Path tempChromLibFile = ChromatogramLibraryUtils.getChromLibTempFile(_container, localDirectory, libraryRevision); + Path tempChromLibFile = ChromatogramLibraryUtils.getChromLibTempFile(_container, localDirectory, libraryRevision).toNioPathForWrite(); try { diff --git a/src/org/labkey/targetedms/parser/speclib/LibSpectrumReader.java b/src/org/labkey/targetedms/parser/speclib/LibSpectrumReader.java index af6d489b4..fcf7f2e7b 100644 --- a/src/org/labkey/targetedms/parser/speclib/LibSpectrumReader.java +++ b/src/org/labkey/targetedms/parser/speclib/LibSpectrumReader.java @@ -29,6 +29,8 @@ import org.labkey.api.util.Pair; import org.labkey.targetedms.parser.Peptide; import org.labkey.targetedms.view.spectrum.LibrarySpectrumMatchGetter; +import org.labkey.vfs.FileLike; +import org.labkey.vfs.FileSystemLike; import org.sqlite.SQLiteConfig; import java.io.File; @@ -161,9 +163,9 @@ private static String getLibCacheKey(@NotNull Container container, String pathSt Path remotePath = pair.second; if (null != container && null != remotePath) { - File file = LocalDirectory.copyToContainerDirectory(container, remotePath, LOG); + FileLike file = LocalDirectory.copyToContainerDirectory(container, FileSystemLike.wrapFile(remotePath), LOG); if (null != file) - return file.getAbsolutePath(); + return file.toNioPathForRead().toFile().getAbsolutePath(); } } return null; diff --git a/src/org/labkey/targetedms/pipeline/TargetedMSImportPipelineJob.java b/src/org/labkey/targetedms/pipeline/TargetedMSImportPipelineJob.java index 04b966e11..ec0cde2df 100644 --- a/src/org/labkey/targetedms/pipeline/TargetedMSImportPipelineJob.java +++ b/src/org/labkey/targetedms/pipeline/TargetedMSImportPipelineJob.java @@ -68,7 +68,7 @@ public TargetedMSImportPipelineJob(ViewBackgroundInfo info, ExpData expData, Sky throw new RuntimeException("Cannot process ExpData when its schema does not match root URI scheme."); LocalDirectory localDirectory = LocalDirectory.create(root, baseLogFileName, - null != _expData.getFile() ? _expData.getFile().getParentFile().getPath() : FileUtil.getTempDirectory().getPath()); + null != _expData.getFile() ? _expData.getFileLike().getParent() : FileUtil.getTempDirectoryFileLike()); setLocalDirectory(localDirectory); setLogFile(localDirectory.determineLogFile()); }