Skip to content

Commit bd509fb

Browse files
Continue adopting FileLike instead of File or Path (#274)
More cleanup
1 parent 209329b commit bd509fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

laboratory/src/org/labkey/laboratory/LaboratoryController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,15 +615,15 @@ protected void setContentType(HttpServletResponse response)
615615
}
616616

617617
@Override
618-
protected File getTargetFile(String filename) throws IOException
618+
protected FileLike getTargetFile(String filename) throws IOException
619619
{
620620
if (!PipelineService.get().hasValidPipelineRoot(getContainer()))
621621
throw new UploadException("Pipeline root must be configured before uploading assay files", HttpServletResponse.SC_NOT_FOUND);
622622

623623
try
624624
{
625625
FileLike targetDirectory = AssayFileWriter.ensureUploadDirectory(getContainer());
626-
return FileUtil.findUniqueFileName(filename, targetDirectory).toNioPathForWrite().toFile();
626+
return FileUtil.findUniqueFileName(filename, targetDirectory);
627627
}
628628
catch (ExperimentException e)
629629
{
@@ -632,14 +632,14 @@ protected File getTargetFile(String filename) throws IOException
632632
}
633633

634634
@Override
635-
public String getResponse(ProcessAssayForm form, Map<String, Pair<File, String>> files) throws UploadException
635+
public String getResponse(ProcessAssayForm form, Map<String, Pair<FileLike, String>> files) throws UploadException
636636
{
637637
JSONObject resp = new JSONObject();
638638
try
639639
{
640-
for (Map.Entry<String, Pair<File, String>> entry : files.entrySet())
640+
for (Map.Entry<String, Pair<FileLike, String>> entry : files.entrySet())
641641
{
642-
File file = entry.getValue().getKey();
642+
File file = entry.getValue().getKey().toNioPathForRead().toFile();
643643
String originalName = entry.getValue().getValue();
644644

645645
if (form.getLabkeyAssayId() == null)

0 commit comments

Comments
 (0)