Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/org/labkey/targetedms/SkylineDocImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions src/org/labkey/targetedms/chromlib/ChromatogramLibraryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down