Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-08-29 13:37:45 +0000
committerThomas Watson2013-08-30 20:24:08 +0000
commit239bf454839d2dd0e0d9e689fa703ca307795890 (patch)
tree57ffaa3ce1965532e534e5bbfd403589b94e9c9b /bundles/org.eclipse.equinox.weaving.hook
parent916c5cb71f2689f1e2f2171f65eb88f7e283d8c4 (diff)
downloadrt.equinox.bundles-239bf454839d2dd0e0d9e689fa703ca307795890.tar.gz
rt.equinox.bundles-239bf454839d2dd0e0d9e689fa703ca307795890.tar.xz
rt.equinox.bundles-239bf454839d2dd0e0d9e689fa703ca307795890.zip
Bug 416073 - Optimize Storage.listEntryPaths for wildcards and recursion.I20130831-1500I20130830-2000
Update Bundle File API clients to use new BundleFileWrapper decorator class.
Diffstat (limited to 'bundles/org.eclipse.equinox.weaving.hook')
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/AbstractWeavingBundleFile.java80
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/hooks/WeavingHook.java5
2 files changed, 6 insertions, 79 deletions
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 cabd7824a..86fe9d0d4 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 abstract class AbstractWeavingBundleFile extends BundleFile {
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 39596e7fd..7d83ee181 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.internal.loader.classpath.ClasspathManager;
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 @@ public class WeavingHook extends AbstractWeavingHook {
* @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

Back to the top