Package org.osgi.framework

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


        //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


    Bundle styleBundle = getStyleBundle();
    if (styleBundle == null) {
      throw new RuntimeException("no style bundle found");
    }
    String path = MEDIA_TYPE_BASE_PATH + mediaType.getType() + "/";
    Enumeration entries = styleBundle.findEntries(path,
        mediaType.getSubtype() + ".*", false);
    String iconUri = createIconUri(entries);
    if (iconUri != null) {
      return iconUri;
    }
View Full Code Here

        mediaType.getSubtype() + ".*", false);
    String iconUri = createIconUri(entries);
    if (iconUri != null) {
      return iconUri;
    }
    entries = styleBundle.findEntries(path, "any.*", false);
    iconUri = createIconUri(entries);
    if (iconUri != null) {
      return iconUri;
    }
    return getDefaultIconUrl(styleBundle);
View Full Code Here

   */
  public ExtenderConfiguration(BundleContext bundleContext) {
    Bundle bundle = bundleContext.getBundle();
    Properties properties = new Properties(createDefaultProperties());

    Enumeration enm = bundle.findEntries(EXTENDER_CFG_LOCATION, XML_PATTERN, false);

    if (enm == null) {
      log.info("No custom extender configuration detected; using defaults...");

      synchronized (lock) {
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

        }

        List<URI> artifacts = new ArrayList<URI>();

        try {
            Enumeration entries = bundle.findEntries("/", "*", true);
            while (entries.hasMoreElements()) {
                URL entry = (URL)entries.nextElement();
                String entryName = entry.getPath();
                if (entryName.startsWith("/"))
                    entryName = entryName.substring(1);
View Full Code Here

                bundleClassPath.add(path.trim());
            }
        }

        try {
            Enumeration<?> entries = bundle.findEntries("/", "*", true);
            while (entries.hasMoreElements()) {
                URL entry = (URL)entries.nextElement();
                String entryName = entry.getPath();
                if (entryName.contains("/.svn/")) {
                    // Ignore .svn files
View Full Code Here

            throw new IllegalArgumentException("Expected DeployableBundle");
        }
        Bundle bundle = ((DeployableBundle) deployable).getBundle();
       
        List<URL> modURLs = new ArrayList<URL>();
        Enumeration e = bundle.findEntries("WEB-INF/", "*.tld", true);
        if (e != null) {
            while (e.hasMoreElements()) {
                modURLs.add((URL) e.nextElement());
            }
        }
View Full Code Here

    public void bundleChanged(BundleEvent bundleEvent) {
            Bundle bundle = bundleEvent.getBundle();
            if (bundleEvent.getType() == BundleEvent.RESOLVED) {
                try {
                    List<URL> urls = new ArrayList<URL>();
                    Enumeration featuresUrlEnumeration = bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
                    while (featuresUrlEnumeration != null && featuresUrlEnumeration.hasMoreElements()) {
                        URL url = (URL) featuresUrlEnumeration.nextElement();
                        try {
                            featuresService.addRepository(url.toURI());
                            URI needRemovedRepo = null;
View Full Code Here

    public void bundleChanged(BundleEvent bundleEvent) {
            Bundle bundle = bundleEvent.getBundle();
            if (bundleEvent.getType() == BundleEvent.RESOLVED) {
                try {
                    List<URL> urls = new ArrayList<URL>();
                    Enumeration featuresUrlEnumeration = bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
                    while (featuresUrlEnumeration != null && featuresUrlEnumeration.hasMoreElements()) {
                        URL url = (URL) featuresUrlEnumeration.nextElement();
                        try {
                            featuresService.addRepository(url.toURI());
                            for (Repository repo : featuresService.listRepositories()) {
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.