Package org.osgi.framework

Examples of org.osgi.framework.Bundle.findEntries()


    public void bundleChanged(BundleEvent bundleEvent) {
        try {
            Bundle bundle = bundleEvent.getBundle();
            if (bundleEvent.getType() == BundleEvent.INSTALLED) {
                Enumeration featuresUrlEnumeration = bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
                while (featuresUrlEnumeration != null && featuresUrlEnumeration.hasMoreElements()) {
                    URL url = (URL) featuresUrlEnumeration.nextElement();
                    RepositoryImpl repo = featuresService.internalAddRepository(url.toURI());
                    for (Feature f : repo.getFeatures()) {
                        featuresService.installFeature(f.getName(), f.getVersion());
View Full Code Here


                        featuresService.installFeature(f.getName(), f.getVersion());
                    }
                    featuresService.internalRemoveRepository(url.toURI());
                }
            } else if (bundleEvent.getType() == BundleEvent.UNINSTALLED) {
                Enumeration featuresUrlEnumeration = bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
                while (featuresUrlEnumeration != null && featuresUrlEnumeration.hasMoreElements()) {
                    URL url = (URL) featuresUrlEnumeration.nextElement();
                    RepositoryImpl repo = featuresService.internalAddRepository(url.toURI());
                    for (Feature f : repo.getFeatures()) {
                        featuresService.uninstallFeature(f.getName(), f.getVersion());
View Full Code Here

        }

        @Override
        public List<URL> findEntries(String path, String filePattern, boolean recurse) {
            Bundle bundle = syscontext.getBundle(module.getModuleId());
            Enumeration<URL> paths = bundle.findEntries(path, filePattern, recurse);
            List<URL> result = new ArrayList<URL>();
            if (paths != null) {
                while (paths.hasMoreElements()) {
                    URL element = paths.nextElement();
                    result.add(element);
View Full Code Here

        }

        @Override
        public List<URL> findEntries(String path, String filePattern, boolean recurse) {
            Bundle bundle = syscontext.getBundle(module.getModuleId());
            Enumeration<URL> paths = bundle.findEntries(path, filePattern, recurse);
            List<URL> result = new ArrayList<URL>();
            if (paths != null) {
                while (paths.hasMoreElements()) {
                    URL element = paths.nextElement();
                    result.add(element);
View Full Code Here

        try {
            // Test if the bundle is an Eclipse project
            boolean devMode = (bundle.getEntry("/.project") != null);
            // FIXME: The entries can come from fragments. Do we need to have a way to differentiate the entries?
            Enumeration<?> entries = bundle.findEntries("/", "*", true);
            while (entries.hasMoreElements()) {
                URL entry = (URL)entries.nextElement();
                String entryName = entry.getPath();
                if (devMode && entryName.contains("/.svn/")
                    || entryName.startsWith("/.")
View Full Code Here

        //Searching the resourceBundle for the given bundle resource paths.
        String resourcePath = CarbonUIUtil.getBundleResourcePath(name);
        Bundle resourceBundle = bundleResourceMap.get(resourcePath);
        if (resourceBundle != null) {
            Enumeration entryPaths = resourceBundle.findEntries(path, file, false);
            /* Enumeration entryPaths = null;
   try {
        entryPaths = resourceBundle.getResources(path + File.separator + file);
   } catch (IOException ignored) {
        log.error(ignored.getMessage(), ignored);
View Full Code Here

        //Searching the resourceBundle for the given bundle resource paths.
        String resourcePath = CarbonUIUtil.getBundleResourcePath(name);
        Bundle resourceBundle = bundleResourceMap.get(resourcePath);

        if (resourceBundle != null) {
            Enumeration e = resourceBundle.findEntries(bundleResourcePath + name, null, false);
            if (e != null) {
                while (e.hasMoreElements()) {
                    URL entryURL = (URL) e.nextElement();
                    result.add(entryURL.getFile().substring(bundleResourcePath.length()));
                }
View Full Code Here

        }

        @Override
        public List<URL> findEntries(String path, String filePattern, boolean recurse) {
            Bundle bundle = context.getBundle(module.getModuleId());
            Enumeration<URL> paths = bundle.findEntries(path, filePattern, recurse);
            List<URL> result = new ArrayList<URL>();
            if (paths != null) {
                while (paths.hasMoreElements()) {
                    URL element = paths.nextElement();
                    result.add(element);
View Full Code Here

        }

        @Override
        public List<URL> findEntries(String path, String filePattern, boolean recurse) {
            Bundle bundle = context.getBundle(module.getModuleId());
            Enumeration<URL> paths = bundle.findEntries(path, filePattern, recurse);
            List<URL> result = new ArrayList<URL>();
            if (paths != null) {
                while (paths.hasMoreElements()) {
                    URL element = paths.nextElement();
                    result.add(element);
View Full Code Here

      }

      // If not any .class or jars not under WEB-INF/classes or WEB/lib
      // dir, return true.
      boolean result = true;
      Enumeration<URL> entries = wab.findEntries("/", "*.class", true);
      while (entries != null && entries.hasMoreElements()) {
        String path = entries.nextElement().getPath();
        if (!path.contains("WEB-INF/classes")) {
          result = false;
          break;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.