]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java
Add integer standard type
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / src / org / argeo / osgi / boot / DistributionBundle.java
index 0d0cb93219edeb38f0a21eeabbf7a74a08c4a65f..a336b6446c920f656f2457fbbcd3fe3bd0d86221 100644 (file)
@@ -1,18 +1,3 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.argeo.osgi.boot;
 
 import java.io.BufferedReader;
@@ -187,11 +172,13 @@ public class DistributionBundle {
                try {
                        reader = new BufferedReader(new InputStreamReader(in));
                        String line = null;
-                       while ((line = reader.readLine()) != null) {
+                       lines: while ((line = reader.readLine()) != null) {
                                StringTokenizer st = new StringTokenizer(line, separator);
                                String moduleName = st.nextToken();
                                String moduleVersion = st.nextToken();
                                String relativeUrl = st.nextToken();
+                               if (relativeUrl.endsWith(".pom"))
+                                       continue lines;
                                osgiArtifacts.add(new OsgiArtifact(moduleName, moduleVersion, relativeUrl));
                        }
                } catch (Exception e) {
@@ -201,8 +188,8 @@ public class DistributionBundle {
        }
 
        /** Convenience method */
-       public static DistributionBundle processUrl(String baseUrl, String realtiveUrl, String localCache) {
-               DistributionBundle distributionBundle = new DistributionBundle(baseUrl, realtiveUrl, localCache);
+       public static DistributionBundle processUrl(String baseUrl, String relativeUrl, String localCache) {
+               DistributionBundle distributionBundle = new DistributionBundle(baseUrl, relativeUrl, localCache);
                distributionBundle.processUrl();
                return distributionBundle;
        }
@@ -230,8 +217,8 @@ public class DistributionBundle {
                                localUri = null;
                        }
                        Version version = new Version(osgiArtifact.getVersion());
-                       if (localUri != null && Files.exists(Paths.get(localUri))
-                                       && version.getQualifier()!=null         && version.getQualifier().startsWith("SNAPSHOT")) {
+                       if (localUri != null && Files.exists(Paths.get(localUri)) && version.getQualifier() != null
+                                       && version.getQualifier().startsWith("SNAPSHOT")) {
                                urls.add(localCache + osgiArtifact.getRelativeUrl());
                        } else {
                                urls.add(baseUrl + osgiArtifact.getRelativeUrl());