]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ArchiveWrapper.java
Rename CategoryNameVersion.
[gpl/argeo-slc.git] / org.argeo.slc.repo / src / org / argeo / slc / repo / osgi / ArchiveWrapper.java
index d53078ec5622ce8d4799e1cbea74e4a73c777844..a6551a6e4d9fbcdbc436bfbfd31be348346ef1d8 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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;
@@ -86,6 +86,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<? extends NameVersion> nameVersions() {
                if (wrappers.size() > 0)
                        return wrappers.values().iterator();
@@ -95,7 +107,7 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution {
 
        @SuppressWarnings("resource")
        protected Iterator<? extends NameVersion> osgiNameVersions() {
-               List<CategorizedNameVersion> nvs = new ArrayList<CategorizedNameVersion>();
+               List<CategoryNameVersion> nvs = new ArrayList<CategoryNameVersion>();
 
                Session distSession = null;
                ZipInputStream zin = null;
@@ -127,7 +139,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 +265,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 +418,16 @@ public class ArchiveWrapper implements Runnable, ModuleSet, Distribution {
                this.sourcesProvider = sourcesProvider;
        }
 
+       public Map<String, BndWrapper> getWrappers() {
+               return wrappers;
+       }
+
+       public Map<String, String> getIncludes() {
+               return includes;
+       }
+
+       public List<String> getExcludes() {
+               return excludes;
+       }
+
 }