aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahrw...@apache.org
Subject svn commit: r1136922 - in /aries/trunk/application: application-api/src/main/java/org/apache/aries/application/modelling/ application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ application-modeller-standalone/ applicatio...
Date Fri, 17 Jun 2011 16:12:52 GMT
Author: mahrwald
Date: Fri Jun 17 16:12:51 2011
New Revision: 1136922

URL: http://svn.apache.org/viewvc?rev=1136922&view=rev
Log:
ARIES-676: Some more useful methods on ModelledResourceManager API

Modified:
    aries/trunk/application/application-api/src/main/java/org/apache/aries/application/modelling/ModelledResourceManager.java
    aries/trunk/application/application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ModellerTest.java
    aries/trunk/application/application-modeller-standalone/pom.xml
    aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceManagerImpl.java

Modified: aries/trunk/application/application-api/src/main/java/org/apache/aries/application/modelling/ModelledResourceManager.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-api/src/main/java/org/apache/aries/application/modelling/ModelledResourceManager.java?rev=1136922&r1=1136921&r2=1136922&view=diff
==============================================================================
--- aries/trunk/application/application-api/src/main/java/org/apache/aries/application/modelling/ModelledResourceManager.java
(original)
+++ aries/trunk/application/application-api/src/main/java/org/apache/aries/application/modelling/ModelledResourceManager.java
Fri Jun 17 16:12:51 2011
@@ -18,18 +18,66 @@
  */
 package org.apache.aries.application.modelling;
 
+import java.io.IOException;
+import java.io.InputStream;
+
 import org.apache.aries.util.filesystem.IDirectory;
 
 public interface ModelledResourceManager
 {
   /**
-   * Obtain a ModelledResource object
-   * @param uri the file uri
+   * Utility interface for re-presenting a source of InputStreams
+   */
+  interface InputStreamProvider {
+    /** 
+     * Return a fresh input stream
+     */
+    InputStream open() throws IOException;
+  }
+    
+  /**
+   * Obtain a ModelledResource object.
+   * @param uri The URI to the conceptual location of the bundle, that will be returned from
the getLocation method
+   * on {@link ModelledResource}
    * @param bundle the bundle file
    * @return the modelled resource.
-   */
+   */    
   ModelledResource getModelledResource(String uri, IDirectory bundle) throws ModellerException;
+  
+  /**
+   * Obtain a ModelledResource object. 
+   * 
+   * This method is equivalent to calling <pre>getModelledResource(bundle.toURL().toURI().toString(),
bundle)</pre>
+   * @param bundle the bundle file
+   * @return the modelled resource.
+   */    
+  ModelledResource getModelledResource(IDirectory bundle) throws ModellerException;
+  
+  /**
+   * Obtain a ModelledResource via InputStreams
+   * 
+   * 
+   * @param uri The URI to the conceptual location of the bundle, that will be returned from
the getLocation method
+   * on {@link ModelledResource}
+   * @param bundle The bundle
+   * @return
+   * @throws ModellerException
+   */
+  ModelledResource getModelledResource(String uri, InputStreamProvider bundle) throws ModellerException;
 
+  /**
+   * Parse service and reference elements of a bundle
+   * @param archive
+   * @return
+   * @throws ModellerException
+   */
   ParsedServiceElements getServiceElements (IDirectory archive) throws ModellerException;

 
+  /**
+   * Parse service and reference elements of a bundle
+   * @param archive
+   * @return
+   * @throws ModellerException
+   */
+  ParsedServiceElements getServiceElements (InputStreamProvider archive) throws ModellerException;
  
 }

Modified: aries/trunk/application/application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ModellerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ModellerTest.java?rev=1136922&r1=1136921&r2=1136922&view=diff
==============================================================================
--- aries/trunk/application/application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ModellerTest.java
(original)
+++ aries/trunk/application/application-modeller-common-test/src/test/java/org/apache/aries/application/modelling/ModellerTest.java
Fri Jun 17 16:12:51 2011
@@ -1,9 +1,13 @@
 package org.apache.aries.application.modelling;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.List;
+import java.util.jar.Manifest;
 
 import org.apache.aries.application.modelling.ExportedPackage;
 import org.apache.aries.application.modelling.ImportedPackage;
@@ -16,82 +20,117 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.standalone.OfflineModellingFactory;
 import org.apache.aries.mocks.BundleContextMock;
 import org.apache.aries.util.filesystem.FileSystem;
+import org.apache.aries.util.filesystem.IOUtils;
 import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
-
 import static org.junit.Assert.*;
 
 @RunWith(Parameterized.class)
 public class ModellerTest {
-    
+
     @Parameters
     public static List<Object[]> getDifferentModelledResourceManagers() {
         ModelledResourceManagerImpl manager = new ModelledResourceManagerImpl();
         manager.setModellingManager(new ModellingManagerImpl());
         manager.setParserProxy(ParserProxyTest.getMockParserServiceProxy());
-        
+
         return Arrays.asList(new Object[][] {
                 {OfflineModellingFactory.getModelledResourceManager()},
                 {manager}
         });
     }
-    
+
+    @BeforeClass
+    public static void setup() throws Exception {
+        URL pathToTestBundle = ModellerTest.class.getClassLoader().getResource("test.bundle");
+        File testBundleDir = new File(pathToTestBundle.toURI());
+        File outputArchive = new File(testBundleDir.getParentFile(), "test.bundle.jar");
+
+        FileInputStream fis = new FileInputStream(new File(testBundleDir, "META-INF/MANIFEST.MF"));
+        Manifest manifest = new Manifest(fis);
+        fis.close();
+
+        IOUtils.jarUp(testBundleDir, outputArchive, manifest);
+    }
+
     @AfterClass
     public static void cleanup() {
         BundleContextMock.clear();
     }
-    
-	private final ModelledResourceManager sut;
-	
-	public ModellerTest(ModelledResourceManager sut) {
-	    this.sut = sut;
-	}
-	
-	@Test
-	public void testParsingOfBundle() throws Exception {
-		URL pathToTestBundle = getClass().getClassLoader().getResource("test.bundle");
-		
-		ModelledResource resource = sut.getModelledResource(
-				"file:///some.uri", 
-				FileSystem.getFSRoot(new File(pathToTestBundle.toURI())));
-		
-		assertNotNull(resource);
-		
-		// sanity check that we have parsed the manifest and package imports / exports
-		
-		assertEquals("test.bundle", resource.getSymbolicName());
-		assertEquals("1.0.0", resource.getVersion());
-		assertEquals(1, resource.getExportedPackages().size());
-		assertEquals(3, resource.getImportedPackages().size());
-		
-		boolean foundFirstPackage = false;
-		
-		for (ImportedPackage pack : resource.getImportedPackages()) {
-		    if ("javax.jms".equals(pack.getPackageName()) && "1.1.0".equals(pack.getVersionRange()))
-		        foundFirstPackage = true;
-		}
-		
-		assertTrue(foundFirstPackage);
-		
-		ExportedPackage epack = resource.getExportedPackages().iterator().next();
-		assertEquals("wibble", epack.getPackageName());
-		assertEquals("1.0.0", epack.getVersion());
-		
-		assertEquals("true", epack.getAttributes().get("directive:"));
-		
-		
-		// sanity check that we have parsed the services
-		
-		assertEquals(3, resource.getExportedServices().size());
-		assertEquals(1, resource.getImportedServices().size());
-		
-		ImportedService service = resource.getImportedServices().iterator().next();
-		assertEquals("foo.bar.MyInjectedService", service.getInterface());
-		assertTrue(service.isOptional());
-		assertFalse(service.isList());
-		assertEquals("anOptionalReference", service.getId());
-	}
+
+    private final ModelledResourceManager sut;
+
+    public ModellerTest(ModelledResourceManager sut) {
+        this.sut = sut;
+    }
+
+    @Test
+    public void testParsingByInputStreamProvider() throws Exception {
+        final URL pathToTestBundle = getClass().getClassLoader().getResource("test.bundle.jar");
+
+        ModelledResource resource = sut.getModelledResource("file:///test.bundle.uri", 
+                new ModelledResourceManager.InputStreamProvider() {                    
+                    public InputStream open() throws IOException {
+                        return pathToTestBundle.openStream();
+                    }
+                }
+        );
+        
+        checkTestBundleResource(resource);
+    }
+
+    @Test
+    public void testParsingOfBundle() throws Exception {
+        URL pathToTestBundle = getClass().getClassLoader().getResource("test.bundle");
+
+        ModelledResource resource = sut.getModelledResource(
+                "file:///test.bundle.uri", 
+                FileSystem.getFSRoot(new File(pathToTestBundle.toURI())));
+
+        checkTestBundleResource(resource);
+    }
+
+    private void checkTestBundleResource(ModelledResource resource) {
+        assertNotNull(resource);
+
+        assertEquals("file:///test.bundle.uri", resource.getLocation());
+        
+        // sanity check that we have parsed the manifest and package imports / exports
+
+        assertEquals("test.bundle", resource.getSymbolicName());
+        assertEquals("1.0.0", resource.getVersion());
+        assertEquals(1, resource.getExportedPackages().size());
+        assertEquals(3, resource.getImportedPackages().size());
+
+        boolean foundFirstPackage = false;
+
+        for (ImportedPackage pack : resource.getImportedPackages()) {
+            if ("javax.jms".equals(pack.getPackageName()) && "1.1.0".equals(pack.getVersionRange()))
+                foundFirstPackage = true;
+        }
+
+        assertTrue(foundFirstPackage);
+
+        ExportedPackage epack = resource.getExportedPackages().iterator().next();
+        assertEquals("wibble", epack.getPackageName());
+        assertEquals("1.0.0", epack.getVersion());
+
+        assertEquals("true", epack.getAttributes().get("directive:"));
+
+
+        // sanity check that we have parsed the services
+
+        assertEquals(3, resource.getExportedServices().size());
+        assertEquals(1, resource.getImportedServices().size());
+
+        ImportedService service = resource.getImportedServices().iterator().next();
+        assertEquals("foo.bar.MyInjectedService", service.getInterface());
+        assertTrue(service.isOptional());
+        assertFalse(service.isList());
+        assertEquals("anOptionalReference", service.getId());
+    }
 }

Modified: aries/trunk/application/application-modeller-standalone/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller-standalone/pom.xml?rev=1136922&r1=1136921&r2=1136922&view=diff
==============================================================================
--- aries/trunk/application/application-modeller-standalone/pom.xml (original)
+++ aries/trunk/application/application-modeller-standalone/pom.xml Fri Jun 17 16:12:51 2011
@@ -42,11 +42,6 @@
 
     <dependencies>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.aries</groupId>
             <artifactId>org.apache.aries.util</artifactId>
             <version>0.4-SNAPSHOT</version>

Modified: aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceManagerImpl.java?rev=1136922&r1=1136921&r2=1136922&view=diff
==============================================================================
--- aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceManagerImpl.java
(original)
+++ aries/trunk/application/application-modeller/src/main/java/org/apache/aries/application/modelling/impl/ModelledResourceManagerImpl.java
Fri Jun 17 16:12:51 2011
@@ -24,6 +24,7 @@ import static org.apache.aries.applicati
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -32,6 +33,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.jar.Attributes;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
 
 import org.apache.aries.application.InvalidAttributeException;
 import org.apache.aries.application.modelling.ExportedService;
@@ -46,6 +49,7 @@ import org.apache.aries.application.mode
 import org.apache.aries.application.modelling.internal.MessageUtil;
 import org.apache.aries.util.filesystem.IDirectory;
 import org.apache.aries.util.filesystem.IFile;
+import org.apache.aries.util.filesystem.IOUtils;
 import org.apache.aries.util.manifest.BundleManifest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,8 +68,8 @@ public class ModelledResourceManagerImpl
   public void setParserProxy (ParserProxy p) { 
     _parserProxy = p;
   }
-  public ParserProxy getParserProxy()
-  {
+  
+  public ParserProxy getParserProxy() {
     return _parserProxy;
   }
 
@@ -82,16 +86,35 @@ public class ModelledResourceManagerImpl
    */
   @Override
   public ParsedServiceElements getServiceElements (IDirectory archive) throws ModellerException
{ 
-
-    _logger.debug(LOG_ENTRY,"getServiceElements", archive );
+      BundleManifest bm = BundleManifest.fromBundle(archive);
+      return getServiceElements(bm, archive);
+  }
+  
+  @Override
+  public ParsedServiceElements getServiceElements(InputStreamProvider archive) throws ModellerException
{
+      try {
+          BundleManifest bm = BundleManifest.fromBundle(archive.open());
+          return getServiceElements(bm, findBlueprints(bm, archive.open()));
+      } catch (IOException e) {
+          throw new ModellerException(e);
+      }
+  }
+  
+  private ParsedServiceElements getServiceElements (BundleManifest bundleMf, IDirectory archive)
throws ModellerException { 
+      try {
+        return getServiceElements(bundleMf, findBlueprints(bundleMf, archive));
+    } catch (IOException e) {
+        throw new ModellerException(e);
+    }
+  }
+  
+  private ParsedServiceElements getServiceElements (BundleManifest bundleMf, Iterable<InputStream>
blueprints) throws ModellerException { 
+    _logger.debug(LOG_ENTRY,"getServiceElements", new Object[] {bundleMf, blueprints} );
 
     Set<ExportedService> services = new HashSet<ExportedService>();
     Set<ImportedService> references = new HashSet<ImportedService>();
     try { 
-      Collection<IFile> blueprints = findBlueprints(archive);
-      InputStream is = null;
-      for (IFile bpFile : blueprints) {
-    	is = bpFile.open();
+      for (InputStream is : blueprints) {
         try {
           ParsedServiceElements pse = getParserProxy().parseAllServiceElements(is);
           services.addAll(pse.getServices());
@@ -103,14 +126,6 @@ public class ModelledResourceManagerImpl
           }
         }
       }
-    } catch (URISyntaxException e) {
-      ModellerException m = new ModellerException(e);
-      _logger.debug(LOG_EXIT, "getServiceElements", m);
-      throw m;
-    } catch (IOException e) {
-      ModellerException m = new ModellerException(e);
-      _logger.debug(LOG_EXIT, "getServiceElements", m);
-      throw m;
     } catch (Exception e) {
       ModellerException m = new ModellerException(e);
       _logger.debug(LOG_EXIT, "getServiceElements", m);
@@ -122,25 +137,36 @@ public class ModelledResourceManagerImpl
   }
 
   @Override
+  public ModelledResource getModelledResource(IDirectory bundle) throws ModellerException
{
+      try {
+          return getModelledResource(bundle.toURL().toURI().toString(), bundle);
+      } catch (MalformedURLException mue) {
+          throw new ModellerException(mue);
+      } catch (URISyntaxException use) {
+          throw new ModellerException(use);
+      }
+  }
+
+  @Override
+  public ModelledResource getModelledResource(String uri, InputStreamProvider bundle) throws
ModellerException {
+      try {
+          BundleManifest bm = BundleManifest.fromBundle(bundle.open());
+          ParsedServiceElements pse = getServiceElements(bm, findBlueprints(bm, bundle.open()));
+          return model(uri, bm, pse);
+      } catch (IOException e) {
+          throw new ModellerException(e);
+      }
+  }
+  
+  @Override
   public ModelledResource getModelledResource(String uri, IDirectory bundle) throws ModellerException{
     _logger.debug(LOG_ENTRY, "getModelledResource", new Object[]{uri, bundle});
 
     if (bundle != null) {
-        ParsedServiceElements pse = getServiceElements(bundle);
-        BundleManifest bm = BundleManifest.fromBundle(bundle);//new File(bundleFile));
-        Attributes attributes = bm.getRawAttributes();
-        ModelledResource mbi = null;
-        try {
-          mbi = _modellingManager.getModelledResource(uri, attributes, pse.getReferences(),
pse.getServices());
-        } catch (InvalidAttributeException iae) {
-          ModellerException me = new ModellerException(iae);
-          _logger.debug(LOG_EXIT, "getModelledResource", me);
-          throw me;
-        }
-        _logger.debug(LOG_EXIT, "getModelledResource", mbi);
-        return mbi;
-    }
-    else {
+        BundleManifest bm = BundleManifest.fromBundle(bundle);
+        ParsedServiceElements pse = getServiceElements(bm, bundle);
+        return model(uri, bm, pse);
+    } else {
       // The bundle does not exist
       ModellerException me = new ModellerException(MessageUtil.getMessage("INVALID_BUNDLE_LOCATION",
bundle));
       _logger.debug(LOG_EXIT, "getModelledResource", me);
@@ -148,69 +174,145 @@ public class ModelledResourceManagerImpl
     }
 
   }
+  
+  private ModelledResource model(String uri, BundleManifest bm, ParsedServiceElements pse)
throws ModellerException {
+      Attributes attributes = bm.getRawAttributes();
+      ModelledResource mbi = null;
+      try {
+        mbi = _modellingManager.getModelledResource(uri, attributes, pse.getReferences(),
pse.getServices());
+      } catch (InvalidAttributeException iae) {
+        ModellerException me = new ModellerException(iae);
+        _logger.debug(LOG_EXIT, "getModelledResource", me);
+        throw me;
+      }
+      _logger.debug(LOG_EXIT, "getModelledResource", mbi);
+      return mbi;      
+  }
 
   /**
    * Helper method to pass a single bundle into findBlueprints 
+   * @param bundleMf The bundle manifest 
    * @param oneBundle a single bundle
    * @return Files for all the blueprint files within the bundle
    * @throws URISyntaxException
    * @throws IOException
-   * @throws OpenFailureException
    */
-  private Collection<IFile> findBlueprints (IDirectory oneBundle) 
-  throws  IOException, URISyntaxException
+  private Iterable<InputStream> findBlueprints(BundleManifest bundleMf, IDirectory
bundle) throws IOException
   {
-    _logger.debug(LOG_ENTRY, "findBlueprints", oneBundle);
-    Set<IDirectory> archiveSet = new HashSet<IDirectory>();
-    archiveSet.add(oneBundle);
-    Collection<IFile> result = findBlueprints (archiveSet);
-    _logger.debug(LOG_EXIT, "findBlueprints", result);
-    return result;
-  }
+    _logger.debug(LOG_ENTRY, "findBlueprints", bundle);
 
-  /**
-   * Locate all blueprint xml files located within a set of bundles. Typically, call findApplicationBundles()
-   * first to determine which bundles within an EBA fall within the range of the Application-Content
header. 
-   * (See the comment on that method). 
-   * @param applicationBundles
-   * @return A Collection of blue print files
-   * @throws URISyntaxException
-   * @throws IOException
-   * @throws OpenFailureException
-   */
-  private Collection<IFile> findBlueprints(Collection<IDirectory> applicationBundles)
-  throws IOException, URISyntaxException
-  {
-    _logger.debug(LOG_ENTRY, "findBlueprints", applicationBundles);
     Collection<IFile> blueprints = new ArrayList<IFile>();
-    for (IDirectory appBundle : applicationBundles) {
-      if (appBundle != null) {
-        BundleManifest bundleMf = BundleManifest.fromBundle(appBundle);
-        BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
-        List<IFile> files = appBundle.listAllFiles();
-        Iterator<IFile> it = files.iterator();
-        while (it.hasNext()) {
-          IFile file = it.next();         
-          String directoryFullPath = file.getName(); 
-          String directoryName = "";
-          String fileName = "";
-          if (directoryFullPath.lastIndexOf("/") != -1) {
+    BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
+    List<IFile> files = bundle.listAllFiles();
+    Iterator<IFile> it = files.iterator();
+    while (it.hasNext()) {
+        IFile file = it.next();         
+        String directoryFullPath = file.getName(); 
+        String directoryName = "";
+        String fileName = "";
+        if (directoryFullPath.lastIndexOf("/") != -1) {
             directoryName = directoryFullPath.substring(0, directoryFullPath.lastIndexOf("/"));
             fileName = directoryFullPath.substring(directoryFullPath.lastIndexOf("/") + 1);
-          } else {
+        } else {
             if (file.isFile()) {
-              directoryName="";
-              fileName = directoryFullPath;
+                directoryName="";
+                fileName = directoryFullPath;
             } 
 
-          }
-          if (bpParser.isBPFile(directoryName, fileName)) {
+        }
+        if (bpParser.isBPFile(directoryName, fileName)) {
             blueprints.add(file);
-          }
         }
-      }
     }
-    _logger.debug(LOG_EXIT, "findBlueprints", blueprints);
-    return blueprints;
+    
+    Collection<InputStream> result = new ArrayList<InputStream>();
+    try {
+        for (IFile bp : blueprints) result.add(bp.open());
+    } catch (IOException e) {
+        // if something went wrong, make sure we still clean up
+        for (InputStream is : result) IOUtils.close(is);
+        
+        throw e;
+    }
+    
+    _logger.debug(LOG_EXIT, "findBlueprints", result);
+    return result;
   }
+
+  private class ZipBlueprintIterator implements Iterator<InputStream> {
+      private final ZipInputStream zip;
+      private final BundleBlueprintParser bpParser;
+      private boolean valid;
+      
+      public ZipBlueprintIterator(ZipInputStream zip, BundleBlueprintParser bpParser) {
+          this.zip = zip;
+          this.bpParser = bpParser;
+      }
+
+      @Override
+      public boolean hasNext() {
+          valid = false;
+          ZipEntry entry;
+          
+          try {
+              while (!valid && (entry = zip.getNextEntry()) != null) {
+                  if (!entry.isDirectory()) {
+                      String name = entry.getName();
+                      String directory = "";
+                      int index = name.lastIndexOf('/');
+                      if (index != -1) {
+                          directory = name.substring(0, index);
+                          name = name.substring(index+1);
+                      }
+                      
+                      if (bpParser.isBPFile(directory, name)) {
+                          valid = true;
+                      }
+                      
+                  }
+              }
+          } catch (IOException e) {
+              _logger.error("Could not open next zip entry", e);
+          }
+          
+          return valid;
+      }
+
+      @Override
+      public InputStream next() {
+          if (!valid) throw new IllegalStateException();
+          
+          return new InputStream() {
+            public int read() throws IOException {
+                return zip.read();
+            }
+              
+            @Override
+            public void close() {
+                // intercept close so that the zipinputstream stays open
+            }
+          };
+      }
+
+      @Override
+      public void remove() {
+          throw new UnsupportedOperationException();
+      }
+      
+  }
+  
+  /**
+   * Internal use only. Different to the general Iterable interface this can return an Iterator
only once.
+   */
+  private Iterable<InputStream> findBlueprints(BundleManifest bundleMf, InputStream
stream) {
+      final BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
+      final ZipInputStream zip = new ZipInputStream(stream);
+      
+      return new Iterable<InputStream>() {
+        public Iterator<InputStream> iterator() {
+            return new ZipBlueprintIterator(zip, bpParser);
+        }
+    };
+  }
+
 }



Mime
View raw message