Skip to content

Commit 8583884

Browse files
ExperimentDataHandler File->FileLike
1 parent 2832ba7 commit 8583884

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

genotyping/src/org/labkey/genotyping/HaplotypeDataHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.labkey.api.assay.AssayService;
4848
import org.labkey.api.view.ActionURL;
4949
import org.labkey.api.view.ViewBackgroundInfo;
50+
import org.labkey.vfs.FileLike;
5051

5152
import java.io.File;
5253
import java.io.IOException;
@@ -70,17 +71,17 @@ public DataType getDataType()
7071
}
7172

7273
@Override
73-
public void importFile(@NotNull ExpData data, File dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context) throws ExperimentException
74+
public void importFile(@NotNull ExpData data, @NotNull FileLike dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context) throws ExperimentException
7475
{
7576
if (!dataFile.exists())
7677
{
77-
log.warn("Could not find file " + dataFile.getAbsolutePath() + " on disk for data with LSID " + data.getLSID());
78+
log.warn("Could not find file " + dataFile + " on disk for data with LSID " + data.getLSID());
7879
return;
7980
}
8081
ExpRun expRun = data.getRun();
8182
if (expRun == null)
8283
{
83-
throw new ExperimentException("Could not load haplotype file " + dataFile.getAbsolutePath() + " because it is not owned by an experiment run");
84+
throw new ExperimentException("Could not load haplotype file " + dataFile + " because it is not owned by an experiment run");
8485
}
8586

8687
try
@@ -100,7 +101,7 @@ public void importFile(@NotNull ExpData data, File dataFile, @NotNull ViewBackgr
100101
Map<String, String> animalIds = new CaseInsensitiveTreeMap<>();
101102
List<HaplotypeIdentifier> haplotypes = new ArrayList<>();
102103
List<HaplotypeAssignmentDataRow> dataRows = new ArrayList<>();
103-
TabLoader tabLoader = new TabLoader(dataFile, true);
104+
TabLoader tabLoader = new TabLoader(dataFile.openInputStream(), true, data.getContainer());
104105
List<Map<String, Object>> rowsMap = tabLoader.load();
105106
parseHaplotypeData(protocol, rowsMap, runPropertyValues, animalIds, haplotypes, dataRows);
106107

0 commit comments

Comments
 (0)