X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FDistributionBundle.java;h=a336b6446c920f656f2457fbbcd3fe3bd0d86221;hb=25a31ea46e5de6ce0de366fdb999588c6788c540;hp=0d0cb93219edeb38f0a21eeabbf7a74a08c4a65f;hpb=86e5f79860a8b3013b40a36c1f06c828d52f5249;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java index 0d0cb9321..a336b6446 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java @@ -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());