Bug 416073 - Optimize Storage.listEntryPaths for wildcards and recursion.

Update Bundle File API clients to use new BundleFileWrapper decorator class.
diff --git a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
index 5a348a2..8667427 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
+++ b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformedBundleFile.java
@@ -29,7 +29,7 @@
  * This class is capable of providing transformed versions of entries contained within a base bundle file.
  * For requests that transform bundle contents into local resources (such as file URLs) the transformed state of the bundle is written to the configuration area.
  */
-public class TransformedBundleFile extends BundleFile {
+public class TransformedBundleFile extends BundleFileWrapper {
 
 	private final TransformerHook transformerHook;
 	private final BundleFile delegate;
@@ -44,7 +44,7 @@
 	 * @param delegate the original file
 	 */
 	public TransformedBundleFile(TransformerHook transformerHook, Generation generation, BundleFile delegate) {
-		super(delegate.getBaseFile());
+		super(delegate);
 		this.transformerHook = transformerHook;
 		this.generation = generation;
 		this.delegate = delegate;
@@ -55,22 +55,10 @@
 		return generation;
 	}
 
-	public void close() throws IOException {
-		delegate.close();
-	}
-
-	public boolean containsDir(String dir) {
-		return delegate.containsDir(dir);
-	}
-
 	public boolean equals(Object obj) {
 		return delegate.equals(obj);
 	}
 
-	public File getBaseFile() {
-		return delegate.getBaseFile();
-	}
-
 	public BundleEntry getEntry(String path) {
 
 		final BundleEntry original = delegate.getEntry(path);
@@ -141,10 +129,6 @@
 		return matcher.matches();
 	}
 
-	public Enumeration getEntryPaths(String path) {
-		return delegate.getEntryPaths(path);
-	}
-
 	/**
 	 * This file is a copy of {@link ZipBundleFile#getFile(String, boolean)}
 	 * with modifications.
@@ -260,10 +244,6 @@
 		return delegate.hashCode();
 	}
 
-	public void open() throws IOException {
-		delegate.open();
-	}
-
 	public String toString() {
 		return delegate.toString();
 	}
diff --git a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerHook.java b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerHook.java
index 0ff8701..26197d4 100644
--- a/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerHook.java
+++ b/bundles/org.eclipse.equinox.transforms.hook/src/org/eclipse/equinox/internal/transforms/TransformerHook.java
@@ -17,6 +17,7 @@
 import org.eclipse.osgi.internal.log.EquinoxLogServices;
 import org.eclipse.osgi.storage.BundleInfo.Generation;
 import org.eclipse.osgi.storage.bundlefile.BundleFile;
+import org.eclipse.osgi.storage.bundlefile.BundleFileWrapper;
 import org.osgi.framework.*;
 
 /**
@@ -30,7 +31,7 @@
 	/**
 	 * @throws IOException  
 	 */
-	public BundleFile wrapBundleFile(BundleFile bundleFile, Generation generation, boolean base) {
+	public BundleFileWrapper wrapBundleFile(BundleFile bundleFile, Generation generation, boolean base) {
 		if (transformers == null || templates == null)
 			return null;
 		return new TransformedBundleFile(this, generation, bundleFile);
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractWeavingBundleFile.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractWeavingBundleFile.java
index cabd782..86fe9d0 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractWeavingBundleFile.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractWeavingBundleFile.java
@@ -13,17 +13,11 @@
 
 package org.eclipse.equinox.weaving.hooks;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-
 import org.eclipse.equinox.weaving.adaptors.IWeavingAdaptor;
-import org.eclipse.osgi.container.Module;
-import org.eclipse.osgi.storage.bundlefile.BundleEntry;
 import org.eclipse.osgi.storage.bundlefile.BundleFile;
+import org.eclipse.osgi.storage.bundlefile.BundleFileWrapper;
 
-public abstract class AbstractWeavingBundleFile extends BundleFile {
+public abstract class AbstractWeavingBundleFile extends BundleFileWrapper {
 
     private final BundleAdaptorProvider adaptorProvider;
 
@@ -32,83 +26,15 @@
     public AbstractWeavingBundleFile(
             final BundleAdaptorProvider adaptorProvider,
             final BundleFile bundleFile) {
-        super(bundleFile.getBaseFile());
+        super(bundleFile);
         this.adaptorProvider = adaptorProvider;
         this.delegate = bundleFile;
     }
 
     /**
-     * @see BundleFile#close()
-     */
-    @Override
-    public void close() throws IOException {
-        delegate.close();
-    }
-
-    /**
-     * @see BundleFile#containsDir(java.lang.String)
-     */
-    @Override
-    public boolean containsDir(final String dir) {
-        return delegate.containsDir(dir);
-    }
-
-    /**
      * @return
      */
     public IWeavingAdaptor getAdaptor() {
         return this.adaptorProvider.getAdaptor();
     }
-
-    /**
-     * @see BundleFile#getBaseFile()
-     */
-    @Override
-    public File getBaseFile() {
-        final File baseFile = delegate.getBaseFile();
-        return baseFile;
-    }
-
-    /**
-     * @see BundleFile#getEntry(java.lang.String)
-     */
-    @Override
-    public BundleEntry getEntry(final String path) {
-        return delegate.getEntry(path);
-    }
-
-    /**
-     * @see BundleFile#getEntryPaths(java.lang.String)
-     */
-    @Override
-    public Enumeration<String> getEntryPaths(final String path) {
-        return delegate.getEntryPaths(path);
-    }
-
-    /**
-     * @see BundleFile#getFile(java.lang.String, boolean)
-     */
-    @Override
-    public File getFile(final String path, final boolean nativeCode) {
-        return delegate.getFile(path, nativeCode);
-    }
-
-    /**
-     * @see BundleFile#getResourceURL(java.lang.String,
-     *      org.eclipse.osgi.container.Module, int)
-     */
-    @Override
-    public URL getResourceURL(final String path, final Module hostModule,
-            final int index) {
-        return delegate.getResourceURL(path, hostModule, index);
-    }
-
-    /**
-     * @see BundleFile#open()
-     */
-    @Override
-    public void open() throws IOException {
-        delegate.open();
-    }
-
 }
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
index 39596e7..7d83ee1 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java
@@ -28,6 +28,7 @@
 import org.eclipse.osgi.storage.BundleInfo.Generation;
 import org.eclipse.osgi.storage.bundlefile.BundleEntry;
 import org.eclipse.osgi.storage.bundlefile.BundleFile;
+import org.eclipse.osgi.storage.bundlefile.BundleFileWrapper;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -211,9 +212,9 @@
      * @see org.eclipse.osgi.internal.hookregistry.BundleFileWrapperFactoryHook#wrapBundleFile(org.eclipse.osgi.storage.bundlefile.BundleFile,
      *      org.eclipse.osgi.storage.BundleInfo.Generation, boolean)
      */
-    public BundleFile wrapBundleFile(final BundleFile bundleFile,
+    public BundleFileWrapper wrapBundleFile(final BundleFile bundleFile,
             final Generation generation, final boolean base) {
-        BundleFile wrapped = null;
+        BundleFileWrapper wrapped = null;
         if (Debug.DEBUG_BUNDLE)
             Debug.println("> WeavingHook.wrapBundleFile() bundle="
                     + (generation.getRevision() != null ? generation