Skip to content

Commit b0e1605

Browse files
FileSystemLike (#149)
* AssayDataHandler and AssayUpload conversion File->FileObject checkpoint * FileLike
1 parent f36c82b commit b0e1605

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

genotyping/src/org/labkey/genotyping/HaplotypeDataCollector.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
import org.labkey.api.exp.api.ExpProtocol;
2525
import org.labkey.api.view.HttpView;
2626
import org.labkey.api.view.JspView;
27+
import org.labkey.vfs.FileLike;
2728

2829
import java.io.ByteArrayInputStream;
29-
import java.io.File;
3030
import java.io.IOException;
3131
import java.util.ArrayList;
3232
import java.util.Collections;
@@ -71,7 +71,7 @@ public String getDescription(ContextType context)
7171

7272
@NotNull
7373
@Override
74-
public Map<String, File> createData(ContextType context) throws IOException, ExperimentException
74+
public Map<String, FileLike> createData(ContextType context) throws IOException, ExperimentException
7575
{
7676
ExpProtocol protocol = context.getProtocol();
7777
String data = context.getRequest().getParameter(HaplotypeAssayProvider.DATA_PROPERTY_NAME);
@@ -95,11 +95,11 @@ public Map<String, File> createData(ContextType context) throws IOException, Exp
9595
}
9696

9797
// NOTE: We use a 'tmp' file extension so that DataLoaderService will sniff the file type by parsing the file's header.
98-
File dir = getFileTargetDir(context);
99-
File file = createFile(protocol, dir, "tmp");
98+
FileLike dir = getFileTargetDir(context);
99+
FileLike file = createFile(protocol, dir, "tmp");
100100
ByteArrayInputStream bIn = new ByteArrayInputStream(data.getBytes(context.getRequest().getCharacterEncoding()));
101101

102-
writeFile(bIn, file);
102+
writeFile(bIn, file.toNioPathForWrite().toFile());
103103
return Collections.singletonMap(PRIMARY_FILE, file);
104104
}
105105

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.labkey.genotyping;
1717

1818
import org.apache.logging.log4j.Logger;
19-
import org.apache.logging.log4j.LogManager;
2019
import org.jetbrains.annotations.NotNull;
2120
import org.junit.Assert;
2221
import org.junit.Test;
@@ -70,7 +69,7 @@ public DataType getDataType()
7069
}
7170

7271
@Override
73-
public void importFile(ExpData data, File dataFile, ViewBackgroundInfo info, Logger log, XarContext context) throws ExperimentException
72+
public void importFile(@NotNull ExpData data, File dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context) throws ExperimentException
7473
{
7574
if (!dataFile.exists())
7675
{

0 commit comments

Comments
 (0)