import static org.argeo.osgi.boot.OsgiBootUtils.warn;
import java.io.File;
+import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
/** Constructor */
public OsgiBoot(BundleContext bundleContext) {
this.bundleContext = bundleContext;
- localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE,
- "file://" + System.getProperty("user.home") + "/.m2/repository/");
+ String homeUri = Paths.get(System.getProperty("user.home")).toUri().toString();
+ localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, homeUri + ".m2/repository/");
}
/*
}
}
} catch (BundleException e) {
+ final String ALREADY_INSTALLED = "is already installed";
String message = e.getMessage();
if ((message.contains("Bundle \"" + SYMBOLIC_NAME_OSGI_BOOT + "\"")
|| message.contains("Bundle \"" + SYMBOLIC_NAME_EQUINOX + "\""))
- && message.contains("is already installed")) {
+ && message.contains(ALREADY_INSTALLED)) {
// silent, in order to avoid warnings: we know that both
// have already been installed...
} else {
- OsgiBootUtils.warn("Could not install bundle from " + url + ": " + message);
+ if (message.contains(ALREADY_INSTALLED)) {
+ if (OsgiBootUtils.isDebug())
+ OsgiBootUtils.warn("Duplicate install from " + url + ": " + message);
+ } else
+ OsgiBootUtils.warn("Could not install bundle from " + url + ": " + message);
}
- if (OsgiBootUtils.debug && !message.contains("is already installed"))
+ if (OsgiBootUtils.debug && !message.contains(ALREADY_INSTALLED))
e.printStackTrace();
}
}