|
1 | 1 | package org.labkey.singlecell.run; |
2 | 2 |
|
3 | | -import org.apache.commons.text.similarity.SimilarityScoreFrom; |
| 3 | +import org.apache.commons.io.FileUtils; |
4 | 4 | import org.json.JSONObject; |
5 | 5 | import org.labkey.api.collections.CaseInsensitiveHashMap; |
6 | | -import org.labkey.api.data.ContainerType; |
7 | 6 | import org.labkey.api.data.SimpleFilter; |
8 | 7 | import org.labkey.api.data.TableInfo; |
9 | 8 | import org.labkey.api.data.TableSelector; |
|
31 | 30 | import org.labkey.singlecell.SingleCellSchema; |
32 | 31 |
|
33 | 32 | import java.io.File; |
| 33 | +import java.io.IOException; |
34 | 34 | import java.sql.SQLException; |
35 | 35 | import java.util.Arrays; |
36 | 36 | import java.util.Collections; |
@@ -127,6 +127,32 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c |
127 | 127 | { |
128 | 128 | throw new PipelineJobException("Unable to find file: " + htmlFile.getPath()); |
129 | 129 | } |
| 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 | + } |
130 | 156 | } |
131 | 157 |
|
132 | 158 | ctx.getFileManager().addIntermediateFiles(output.getIntermediateFiles()); |
|
0 commit comments