|
17 | 17 |
|
18 | 18 | import org.apache.commons.io.IOUtils; |
19 | 19 | import org.apache.commons.lang3.StringUtils; |
20 | | -import org.apache.logging.log4j.Logger; |
21 | 20 | import org.apache.logging.log4j.LogManager; |
| 21 | +import org.apache.logging.log4j.Logger; |
22 | 22 | import org.jetbrains.annotations.Nullable; |
23 | 23 | import org.junit.Assert; |
24 | 24 | import org.junit.Test; |
25 | 25 | import org.labkey.api.module.Module; |
26 | 26 | import org.labkey.api.module.ModuleLoader; |
27 | 27 | import org.labkey.api.pipeline.PipelineJobService; |
28 | | -import org.labkey.api.resource.FileResource; |
29 | 28 | import org.labkey.api.resource.DirectoryResource; |
| 29 | +import org.labkey.api.resource.FileResource; |
30 | 30 | import org.labkey.api.resource.Resource; |
31 | 31 | import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService; |
32 | 32 | import org.labkey.api.settings.AppProps; |
@@ -366,7 +366,7 @@ private List<String> getBaseParams() throws FileNotFoundException |
366 | 366 | throw new RuntimeException("Not found: " + jbzip2.getPath()); |
367 | 367 | } |
368 | 368 |
|
369 | | - File htsjdkJar = new File(libDir, "htsjdk-4.0.0.jar"); |
| 369 | + File htsjdkJar = findJar(libDir, "htsjdk-"); |
370 | 370 | if (!htsjdkJar.exists()) |
371 | 371 | { |
372 | 372 | throw new RuntimeException("Not found: " + htsjdkJar.getPath()); |
@@ -401,6 +401,27 @@ private List<String> getBaseParams() throws FileNotFoundException |
401 | 401 | return params; |
402 | 402 | } |
403 | 403 |
|
| 404 | + private File findJar(final File libDir, final String prefix) |
| 405 | + { |
| 406 | + if (!libDir.exists()) |
| 407 | + { |
| 408 | + throw new RuntimeException("Missing directory: " + libDir); |
| 409 | + } |
| 410 | + |
| 411 | + List<String> jarNames = Arrays.stream(libDir.list()).filter(fn -> fn.startsWith(prefix)).sorted().toList(); |
| 412 | + if (jarNames.isEmpty()) |
| 413 | + { |
| 414 | + throw new RuntimeException("Unable to find JAR with prefix: " + prefix); |
| 415 | + } |
| 416 | + |
| 417 | + if (jarNames.size() > 1) |
| 418 | + { |
| 419 | + _logger.info("More than one JAR found with prefix: " + prefix); |
| 420 | + } |
| 421 | + |
| 422 | + return new File(libDir, jarNames.get(jarNames.size() - 1)); |
| 423 | + } |
| 424 | + |
404 | 425 | private int getThreads() |
405 | 426 | { |
406 | 427 | return _threads; |
|
0 commit comments