Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystemLike #149

Merged
merged 3 commits into from
Oct 10, 2024
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
10 changes: 5 additions & 5 deletions genotyping/src/org/labkey/genotyping/HaplotypeDataCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.view.HttpView;
import org.labkey.api.view.JspView;
import org.labkey.vfs.FileLike;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -71,7 +71,7 @@ public String getDescription(ContextType context)

@NotNull
@Override
public Map<String, File> createData(ContextType context) throws IOException, ExperimentException
public Map<String, FileLike> createData(ContextType context) throws IOException, ExperimentException
{
ExpProtocol protocol = context.getProtocol();
String data = context.getRequest().getParameter(HaplotypeAssayProvider.DATA_PROPERTY_NAME);
Expand All @@ -95,11 +95,11 @@ public Map<String, File> createData(ContextType context) throws IOException, Exp
}

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

writeFile(bIn, file);
writeFile(bIn, file.toNioPathForWrite().toFile());
return Collections.singletonMap(PRIMARY_FILE, file);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.labkey.genotyping;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -70,7 +69,7 @@ public DataType getDataType()
}

@Override
public void importFile(ExpData data, File dataFile, ViewBackgroundInfo info, Logger log, XarContext context) throws ExperimentException
public void importFile(@NotNull ExpData data, File dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context) throws ExperimentException
{
if (!dataFile.exists())
{
Expand Down