public List<BundleDescriptor> scanForBundles(String filterString,ClassLoader loader) throws Exception
    	{
	        Filter filter = (filterString != null) ? FrameworkUtil.createFilter(filterString) : null;

	        loader = (loader != null) ? loader : getClass().getClassLoader();

	        Set<String> bundledJars = findBundles();
	        List<BundleDescriptor> bundles = new ArrayList<BundleDescriptor>();
	        for (Enumeration<URL> e = loader.getResources("META-INF/MANIFEST.MF"); e.hasMoreElements();)
	        {
	            URL manifestURL = e.nextElement();
	            String jarName = manifestURL.toString();
	            int idx = jarName.indexOf('!');
	            if (idx == -1) continue;
	            jarName = jarName.substring(0, idx);
	            idx = jarName.lastIndexOf('/');
	            if (idx == -1) continue;
	            jarName = jarName.substring(idx+1);
	            if (bundledJars.contains(jarName))
	            {
		            Map<String, String> headers = getManifestHeaders(manifestURL);
		            if (headers.containsKey(Constants.BUNDLE_SYMBOLICNAME))
		            {
			            if ((filter == null) || filter.match(new MapToDictionary<String,String>(headers)))
			            {
			            	bundles.add(new BundleDescriptor(loader, getParentURL(manifestURL), headers));
			            }
		            }
	            }
	        }
	        return bundles;
    	}