From 0b110e8416dc4b00319e699da15645fb2f9ec257 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:54:55 +0000 Subject: [PATCH 1/2] chore(deps): bump org.pf4j:pf4j from 2.4.0 to 3.12.1 Bumps [org.pf4j:pf4j](https://github.com/pf4j/pf4j) from 2.4.0 to 3.12.1. - [Release notes](https://github.com/pf4j/pf4j/releases) - [Changelog](https://github.com/pf4j/pf4j/blob/master/CHANGELOG.md) - [Commits](https://github.com/pf4j/pf4j/compare/release-2.4.0...release-3.12.1) --- updated-dependencies: - dependency-name: org.pf4j:pf4j dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index de6961b2b5..a010df036a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -168,7 +168,7 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.apache.commons:commons-csv:1.12.0") implementation("com.sksamuel.diff:diff:1.1.11") - implementation("org.pf4j:pf4j:2.4.0") + implementation("org.pf4j:pf4j:3.12.1") implementation("org.biojava:biojava3-core:3.0") implementation("com.google.code.gson:gson") implementation("com.github.pjfanning:excel-streaming-reader:5.0.2") From b1aeff3147f161984618ed58a659ceeac4486be6 Mon Sep 17 00:00:00 2001 From: Eric Enns <492127+ericenns@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:52:43 -0600 Subject: [PATCH 2/2] chore: fix issue with loading workflow files from plugins --- .../irida/plugins/IridaPlugin.java | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/main/java/ca/corefacility/bioinformatics/irida/plugins/IridaPlugin.java b/src/main/java/ca/corefacility/bioinformatics/irida/plugins/IridaPlugin.java index 92da39e5a8..dd4d026d68 100644 --- a/src/main/java/ca/corefacility/bioinformatics/irida/plugins/IridaPlugin.java +++ b/src/main/java/ca/corefacility/bioinformatics/irida/plugins/IridaPlugin.java @@ -1,9 +1,15 @@ package ca.corefacility.bioinformatics.irida.plugins; import java.awt.Color; +import java.io.IOException; +import java.net.URI; import java.net.URISyntaxException; +import java.nio.file.FileSystem; +import java.nio.file.FileSystemNotFoundException; +import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Collections; import java.util.Optional; import java.util.UUID; @@ -105,11 +111,26 @@ public default Optional getTextColor() { */ public default Path getWorkflowsPath() throws IridaPluginException { try { - return Paths.get(this.getClass() - .getResource("/workflows/") - .toURI()); + URI uri = this.getClass().getResource("/workflows/").toURI(); + String[] array = uri.toString().split("!"); + if (uri.getScheme().equals("jar")) { + FileSystem fs = getFileSystem(new URI(array[0])); + return fs.getPath(array[1]); + } else { + return Paths.get(uri); + } } catch (URISyntaxException e) { throw new IridaPluginException("Error converting path to workflows", e); + } catch (IOException e) { + throw new IridaPluginException("Error converting path to workflows", e); + } + } + + public default FileSystem getFileSystem(URI uri) throws IOException{ + try { + return FileSystems.getFileSystem(uri); + } catch (FileSystemNotFoundException e) { + return FileSystems.newFileSystem(uri, Collections.emptyMap()); } } }