Merge tag 'v2.3.28' into testing
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / osgi / DistributionBundle.java
index 35b66e6b70bf45a6c745142bfb557ee39d441bd6..937c3881b7dbdd99f0b7739ee5fef452fdde80b1 100644 (file)
@@ -1,9 +1,12 @@
 package org.argeo.init.osgi;
 
+import static java.lang.System.Logger.Level.WARNING;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.lang.System.Logger;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -32,6 +35,8 @@ import org.osgi.framework.Version;
  * name of the URL and of the content of the index.
  */
 public class DistributionBundle {
+       private final static Logger logger = System.getLogger(DistributionBundle.class.getName());
+
        private final static String INDEX_FILE_NAME = "modularDistribution.csv";
 
        private final String url;
@@ -113,7 +118,7 @@ public class DistributionBundle {
        public void processUrl() {
                JarInputStream jarIn = null;
                try {
-                       URL u = new URL(url);
+                       URL u = new URI(url).toURL();
 
                        // local cache
                        URI localUri = new URI(localCache + relativeUrl);
@@ -213,7 +218,7 @@ public class DistributionBundle {
                        try {
                                localUri = new URI(localCache + relativeUrl);
                        } catch (URISyntaxException e) {
-                               OsgiBootUtils.warn(e.getMessage());
+                               logger.log(WARNING, e.getMessage());
                                localUri = null;
                        }
                        Version version = new Version(osgiArtifact.getVersion());