X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.repo%2Fsrc%2Forg%2Fargeo%2Fslc%2Frepo%2Fosgi%2FArchiveWrapper.java;h=3cb1e9c8f3264034407568876ea79f5356a7cd33;hb=1b8b4c8443356a7a4adc632f391daa8c0ded8053;hp=d53078ec5622ce8d4799e1cbea74e4a73c777844;hpb=10e9f177944b2737ee018ed695338cfeff4fd0a3;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ArchiveWrapper.java b/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ArchiveWrapper.java index d53078ec5..3cb1e9c8f 100644 --- a/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ArchiveWrapper.java +++ b/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ArchiveWrapper.java @@ -22,10 +22,9 @@ import javax.jcr.Session; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.argeo.api.cms.CmsLog; import org.argeo.jcr.JcrUtils; -import org.argeo.slc.CategorizedNameVersion; +import org.argeo.slc.CategoryNameVersion; import org.argeo.slc.DefaultNameVersion; import org.argeo.slc.ModuleSet; import org.argeo.slc.NameVersion; @@ -34,11 +33,11 @@ import org.argeo.slc.build.Distribution; import org.argeo.slc.build.License; import org.argeo.slc.repo.OsgiFactory; import org.argeo.slc.repo.RepoUtils; +import org.argeo.slc.repo.internal.springutil.AntPathMatcher; +import org.argeo.slc.repo.internal.springutil.PathMatcher; import org.argeo.slc.repo.maven.ArtifactIdComparator; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; -import org.springframework.util.AntPathMatcher; -import org.springframework.util.PathMatcher; import aQute.bnd.osgi.Jar; @@ -48,7 +47,7 @@ import aQute.bnd.osgi.Jar; * need further modification. */ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { - private final static Log log = LogFactory.getLog(ArchiveWrapper.class); + private final static CmsLog log = CmsLog.getLog(ArchiveWrapper.class); private OsgiFactory osgiFactory; private String version; @@ -86,6 +85,18 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { return uri; } + public String getVersion() { + return version; + } + + public License getLicense() { + return license; + } + + public String getUri() { + return uri; + } + public Iterator nameVersions() { if (wrappers.size() > 0) return wrappers.values().iterator(); @@ -95,7 +106,7 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { @SuppressWarnings("resource") protected Iterator osgiNameVersions() { - List nvs = new ArrayList(); + List nvs = new ArrayList(); Session distSession = null; ZipInputStream zin = null; @@ -127,7 +138,7 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { if (nv != null) { if (nv.getName().endsWith(".source")) continue entries; - CategorizedNameVersion cnv = new OsgiCategorizedNV(groupId, nv.getName(), nv.getVersion(), + CategoryNameVersion cnv = new ArchiveWrapperCNV(groupId, nv.getName(), nv.getVersion(), this); nvs.add(cnv); // no need to process further includes @@ -253,10 +264,12 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { } } - if (nothingWasDone) - throw new SlcException("Nothing was done"); + if (nothingWasDone) { + log.error("Nothing was done when wrapping " + uri + ". THE DISTRIBUTION IS INCONSISTENT."); + // throw new SlcException("Nothing was done"); + // TODO Fail if not all wrappers matched + } - // FIXME Fail if not all wrappers matched } catch (Exception e) { throw new SlcException("Cannot wrap distribution " + uri, e); } finally { @@ -404,4 +417,16 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution { this.sourcesProvider = sourcesProvider; } + public Map getWrappers() { + return wrappers; + } + + public Map getIncludes() { + return includes; + } + + public List getExcludes() { + return excludes; + } + }