From 88fd398d2939ab9030274ff822db8a46b32d6a96 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Mon, 16 Oct 2023 09:33:50 +0200 Subject: [PATCH] Use locator path as OSGi installation string --- .../init/a2/AbstractProvisioningSource.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/org.argeo.init/src/org/argeo/init/a2/AbstractProvisioningSource.java b/org.argeo.init/src/org/argeo/init/a2/AbstractProvisioningSource.java index 617e78878..800635c9e 100644 --- a/org.argeo.init/src/org/argeo/init/a2/AbstractProvisioningSource.java +++ b/org.argeo.init/src/org/argeo/init/a2/AbstractProvisioningSource.java @@ -47,17 +47,19 @@ public abstract class AbstractProvisioningSource implements ProvisioningSource { Bundle bundle = bc.installBundle(referenceUrl); return bundle; } else { - - Path tempJar = null; - if (locator instanceof Path && Files.isDirectory((Path) locator)) - tempJar = toTempJar((Path) locator); + Path locatorPath = (Path) locator; + Path pathToUse; + if (locator instanceof Path && Files.isDirectory(locatorPath)) + pathToUse = toTempJar(locatorPath); + else + pathToUse = locatorPath; Bundle bundle; - try (InputStream in = newInputStream(tempJar != null ? tempJar : locator)) { - bundle = bc.installBundle(module.getBranch().getCoordinates(), in); + try (InputStream in = newInputStream(pathToUse)) { + bundle = bc.installBundle(locatorPath.toAbsolutePath().toString(), in); } - if (tempJar != null) - Files.deleteIfExists(tempJar); + if (pathToUse != null) + Files.deleteIfExists(pathToUse); return bundle; } } catch (BundleException | IOException e) { -- 2.30.2