diff --git a/api/src/org/labkey/api/reader/ExcelLoader.java b/api/src/org/labkey/api/reader/ExcelLoader.java index 16c4bd89324..32b613afe2b 100644 --- a/api/src/org/labkey/api/reader/ExcelLoader.java +++ b/api/src/org/labkey/api/reader/ExcelLoader.java @@ -55,6 +55,7 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; +import java.io.BufferedInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -114,7 +115,7 @@ public static boolean isExcel(final FileLike dataFile) { try { - try (InputStream inputStream = dataFile.openInputStream()) + try (InputStream inputStream = new BufferedInputStream(dataFile.openInputStream())) { return ExcelLoader.FILE_TYPE.isType(dataFile.toNioPathForRead(), null, FileUtil.readHeader(inputStream, 8 * 1024)); } diff --git a/assay/src/org/labkey/assay/pipeline/AssayImportRunTask.java b/assay/src/org/labkey/assay/pipeline/AssayImportRunTask.java index 736481badb4..c5316c1a32c 100644 --- a/assay/src/org/labkey/assay/pipeline/AssayImportRunTask.java +++ b/assay/src/org/labkey/assay/pipeline/AssayImportRunTask.java @@ -35,7 +35,6 @@ import org.labkey.api.exp.api.ExpProtocol; import org.labkey.api.exp.api.ExpRun; import org.labkey.api.exp.api.ExperimentService; -import org.labkey.api.exp.pipeline.XarGeneratorId; import org.labkey.api.module.Module; import org.labkey.api.module.ModuleLoader; import org.labkey.api.pipeline.AbstractTaskFactory; @@ -46,7 +45,6 @@ import org.labkey.api.pipeline.PipelineValidationException; import org.labkey.api.pipeline.RecordedAction; import org.labkey.api.pipeline.RecordedActionSet; -import org.labkey.api.pipeline.TaskFactory; import org.labkey.api.pipeline.TaskId; import org.labkey.api.pipeline.XMLBeanTaskFactoryFactory; import org.labkey.api.pipeline.file.AbstractFileAnalysisJob; @@ -70,6 +68,7 @@ import org.labkey.vfs.FileLike; import org.labkey.vfs.FileSystemLike; +import java.io.BufferedInputStream; import java.io.File; import java.io.IOException; import java.net.URI; @@ -95,7 +94,7 @@ public class AssayImportRunTask extends PipelineJob.Task> getRawData(PipelineJob job) throws PipelineJobExceptio { job.getLogger().info("Processing excel file: " + dataFile.getName()); // check to see if this is a multi-sheet format - try (ExcelLoader loader = new ExcelLoader(dataFile.openInputStream(), true, null)) + try (ExcelLoader loader = new ExcelLoader(new BufferedInputStream(dataFile.openInputStream()), true, null)) { List sheets = loader.getSheetNames(); if (sheets.size() > 1) @@ -424,8 +423,6 @@ private FileLike getExplodedZipDir(PipelineJob job, FileLike dataFile) public static class Factory extends AbstractTaskFactory { - private final FileType _outputType = XarGeneratorId.FT_PIPE_XAR_XML; - private String _providerName = "${" + PROVIDER_NAME_PROPERTY + "}"; private String _protocolName = "${" + PROTOCOL_NAME_PROPERTY + "}"; @@ -434,7 +431,7 @@ public Factory() super(AssayImportRunTaskId.class); } - public Factory(Class namespaceClass) + public Factory(Class namespaceClass) { super(namespaceClass); } @@ -468,11 +465,6 @@ public List getInputTypes() return Collections.emptyList(); } - public FileType getOutputType() - { - return _outputType; - } - @Override public String getStatusName() { @@ -802,7 +794,7 @@ public RecordedActionSet run() throws PipelineJobException createData(matchedFile, assayDataType); - AssayRunUploadContext.Factory factory + AssayRunUploadContext.Factory> factory = provider.createRunUploadFactory(protocol, user, container); factory.setName(getName()); @@ -828,7 +820,7 @@ public RecordedActionSet run() throws PipelineJobException factory.setLogger(getJob().getLogger()); - AssayRunUploadContext uploadContext = factory.create(); + AssayRunUploadContext uploadContext = factory.create(); Long batchId = null; @@ -857,7 +849,7 @@ public RecordedActionSet run() throws PipelineJobException // } // Check if we've been cancelled. If so, delete any newly created runs from the database - PipelineStatusFile statusFile = PipelineService.get().getStatusFile(getJob().getLogFile()); + PipelineStatusFile statusFile = PipelineService.get().getStatusFile(getJob().getContainer(), getJob().getLogFileLike()); if (statusFile != null && (PipelineJob.TaskStatus.cancelled.matches(statusFile.getStatus()) || PipelineJob.TaskStatus.cancelling.matches(statusFile.getStatus()))) { getJob().info("Deleting run " + run.getName() + " due to cancellation request");