Skip to content

Commit d59d5e7

Browse files
committed
Copy nimble report when completed
1 parent c224592 commit d59d5e7

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

singlecell/src/org/labkey/singlecell/run/RepeatNimbleReportHandler.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package org.labkey.singlecell.run;
22

3-
import org.apache.commons.text.similarity.SimilarityScoreFrom;
3+
import org.apache.commons.io.FileUtils;
44
import org.json.JSONObject;
55
import org.labkey.api.collections.CaseInsensitiveHashMap;
6-
import org.labkey.api.data.ContainerType;
76
import org.labkey.api.data.SimpleFilter;
87
import org.labkey.api.data.TableInfo;
98
import org.labkey.api.data.TableSelector;
@@ -31,6 +30,7 @@
3130
import org.labkey.singlecell.SingleCellSchema;
3231

3332
import java.io.File;
33+
import java.io.IOException;
3434
import java.sql.SQLException;
3535
import java.util.Arrays;
3636
import java.util.Collections;
@@ -127,6 +127,32 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
127127
{
128128
throw new PipelineJobException("Unable to find file: " + htmlFile.getPath());
129129
}
130+
131+
// Replace the originals:
132+
try
133+
{
134+
File targetHtml = new File(so.getFile().getParentFile(), htmlFile.getName());
135+
if (targetHtml.exists())
136+
{
137+
targetHtml.delete();
138+
}
139+
FileUtils.moveFile(htmlFile, targetHtml);
140+
141+
File targetReport = new File(so.getFile().getParentFile(), reportFile.getName());
142+
if (targetReport.exists())
143+
{
144+
targetReport.delete();
145+
}
146+
else
147+
{
148+
ctx.getLogger().error("Expected report file to exist: " + targetReport.getPath());
149+
}
150+
FileUtils.moveFile(reportFile, targetReport);
151+
}
152+
catch (IOException e)
153+
{
154+
throw new PipelineJobException(e);
155+
}
130156
}
131157

132158
ctx.getFileManager().addIntermediateFiles(output.getIntermediateFiles());

0 commit comments

Comments
 (0)