X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.repo%2Fsrc%2Forg%2Fargeo%2Fslc%2Frepo%2FModularDistributionIndexer.java;h=77e8f842260ee57a330abf77d2b5218b79524304;hb=305ecfa036fac8562fbb3af875c6ecf5822b6dcb;hp=d89077322a73af49d2ef074b9ac7306dea5e4203;hpb=0c444984b6249f5bce331a9b1c02ad55369dacfc;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.repo/src/org/argeo/slc/repo/ModularDistributionIndexer.java b/org.argeo.slc.repo/src/org/argeo/slc/repo/ModularDistributionIndexer.java index d89077322..77e8f8422 100644 --- a/org.argeo.slc.repo/src/org/argeo/slc/repo/ModularDistributionIndexer.java +++ b/org.argeo.slc.repo/src/org/argeo/slc/repo/ModularDistributionIndexer.java @@ -21,8 +21,8 @@ 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.DefaultNameVersion; +import org.argeo.slc.CategoryNameVersion; +import org.argeo.slc.DefaultCategoryNameVersion; import org.argeo.slc.NameVersion; import org.argeo.slc.SlcException; import org.argeo.slc.SlcNames; @@ -111,7 +111,7 @@ public class ModularDistributionIndexer implements NodeIndexer, SlcNames { // Helpers private Node addModule(Node modules, NameVersion nameVersion) throws RepositoryException { - CategorizedNameVersion cnv = (CategorizedNameVersion) nameVersion; + CategoryNameVersion cnv = (CategoryNameVersion) nameVersion; Node moduleCoord = null; moduleCoord = modules.addNode(cnv.getName(), SlcTypes.SLC_MODULE_COORDINATES); moduleCoord.setProperty(SlcNames.SLC_CATEGORY, cnv.getCategory()); @@ -126,7 +126,7 @@ public class ModularDistributionIndexer implements NodeIndexer, SlcNames { try { jarIn = new JarInputStream(fileBinary.getStream()); - List modules = new ArrayList(); + List modules = new ArrayList(); // meta data manifest = jarIn.getManifest(); @@ -169,7 +169,7 @@ public class ModularDistributionIndexer implements NodeIndexer, SlcNames { st.nextToken(); // moduleVersion String relativeUrl = st.nextToken(); Artifact currModule = AetherUtils.convertPathToArtifact(relativeUrl, null); - modules.add(new MyCategorizedNameVersion(currModule.getGroupId(), currModule.getArtifactId(), + modules.add(new DefaultCategoryNameVersion(currModule.getGroupId(), currModule.getArtifactId(), currModule.getVersion())); } return new MyModularDistribution(distribution, modules); @@ -181,33 +181,19 @@ public class ModularDistributionIndexer implements NodeIndexer, SlcNames { } } - /** The created modular distribution */ - private static class MyCategorizedNameVersion extends DefaultNameVersion implements CategorizedNameVersion { - private final String category; - - public MyCategorizedNameVersion(String category, String name, String version) { - super(name, version); - this.category = category; - } - - public String getCategory() { - return category; - } - } - /** * A consistent and versioned OSGi distribution, which can be built and tested. */ private class MyModularDistribution extends ArtifactDistribution implements ArgeoOsgiDistribution { - private List modules; + private List modules; - public MyModularDistribution(Artifact artifact, List modules) { + public MyModularDistribution(Artifact artifact, List modules) { super(artifact); this.modules = modules; } - public Iterator nameVersions() { + public Iterator nameVersions() { return modules.iterator(); }