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
3 changes: 2 additions & 1 deletion api/src/org/labkey/api/reader/ExcelLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
22 changes: 7 additions & 15 deletions assay/src/org/labkey/assay/pipeline/AssayImportRunTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -95,7 +94,7 @@ public class AssayImportRunTask extends PipelineJob.Task<AssayImportRunTask.Fact
public static class FactoryFactory implements XMLBeanTaskFactoryFactory
{
@Override
public TaskFactory create(TaskId taskId, TaskType xobj, Path taskDir)
public Factory create(TaskId taskId, TaskType xobj, Path taskDir)
{
if (taskId.getModuleName() == null)
throw new IllegalArgumentException("Task factory must be defined by a module");
Expand Down Expand Up @@ -245,7 +244,7 @@ List<Map<String, Object>> 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<String> sheets = loader.getSheetNames();
if (sheets.size() > 1)
Expand Down Expand Up @@ -424,8 +423,6 @@ private FileLike getExplodedZipDir(PipelineJob job, FileLike dataFile)

public static class Factory extends AbstractTaskFactory<AssayImportRunTaskFactorySettings, Factory>
{
private final FileType _outputType = XarGeneratorId.FT_PIPE_XAR_XML;

private String _providerName = "${" + PROVIDER_NAME_PROPERTY + "}";
private String _protocolName = "${" + PROTOCOL_NAME_PROPERTY + "}";

Expand All @@ -434,7 +431,7 @@ public Factory()
super(AssayImportRunTaskId.class);
}

public Factory(Class namespaceClass)
public Factory(Class<?> namespaceClass)
{
super(namespaceClass);
}
Expand Down Expand Up @@ -468,11 +465,6 @@ public List<FileType> getInputTypes()
return Collections.emptyList();
}

public FileType getOutputType()
{
return _outputType;
}

@Override
public String getStatusName()
{
Expand Down Expand Up @@ -802,7 +794,7 @@ public RecordedActionSet run() throws PipelineJobException
createData(matchedFile, assayDataType);


AssayRunUploadContext.Factory<? extends AssayProvider, ? extends AssayRunUploadContext.Factory> factory
AssayRunUploadContext.Factory<? extends AssayProvider, ? extends AssayRunUploadContext.Factory<?, ?>> factory
= provider.createRunUploadFactory(protocol, user, container);

factory.setName(getName());
Expand All @@ -828,7 +820,7 @@ public RecordedActionSet run() throws PipelineJobException

factory.setLogger(getJob().getLogger());

AssayRunUploadContext uploadContext = factory.create();
AssayRunUploadContext<?> uploadContext = factory.create();

Long batchId = null;

Expand Down Expand Up @@ -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");
Expand Down