Package org.osgi.framework

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


        }

        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


        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

            throw new IllegalArgumentException("Expected DeployableBundle");
        }
        Bundle bundle = ((DeployableBundle) deployable).getBundle();

        List<URL> modURLs = new ArrayList<URL>();
        Enumeration<URL> e = bundle.findEntries("WEB-INF/", "*.tld", true);
        if (e != null) {
            while (e.hasMoreElements()) {
                URL tldURL = e.nextElement();
                String tldPath = tldURL.getPath();
                if (tldPath.startsWith("/WEB-INF/classes") || tldPath.startsWith("/WEB-INF/lib") || (tldPath.startsWith("/WEB-INF/tags") && !tldPath.endsWith("implicit.tld"))) {
View Full Code Here

      public List<URL> findEntries(String path, String filePattern, int options) {
        Bundle systemBundle = SystemBundleLoader.this.getBundle();
        boolean recurse = (options & BundleWiring.FINDENTRIES_RECURSE) != 0;
        @SuppressWarnings("unchecked")
        List<URL> result = Collections.EMPTY_LIST;
        Enumeration<URL> entries = systemBundle.findEntries(path, filePattern, recurse);
        if (entries != null) {
          result = new ArrayList<URL>();
          while (entries.hasMoreElements())
            result.add(entries.nextElement());
        }
View Full Code Here

        // Add org.apache.uima.runtime jar to class path
        Bundle bundle = LauncherPlugin.getDefault().getBundle("org.apache.uima.runtime");
       
        // Ignore the case when runtime bundle does not exist ...
        if (bundle != null) {
          Enumeration<?> jarEnum = bundle.findEntries("/", "*.jar", true);
          while (jarEnum != null && jarEnum.hasMoreElements()) {
            URL element = (URL) jarEnum.nextElement();
            extendedClasspath.add(FileLocator.toFileURL(element).getFile());
          }
        }
View Full Code Here

   
    public void testEndpointDescriptionXMLFiles() {
        URL ed1URL = getClass().getResource("/ed1.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(ed1URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

   
    public void testAllEndpoints1() {
        URL ed1URL = getClass().getResource("/ed1.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(ed1URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testAllEndpoints2() throws Exception {
        URL ed2URL = getClass().getResource("/ed2.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(ed2URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

   
    public void testLegacyServiceDescriptionFormat() {
        URL sdURL = getClass().getResource("/sd.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(sdURL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

   
    public void testLegacyServiceDescriptionFormat2() {
        URL sdURL = getClass().getResource("/sd2.xml");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.findEntries(
            EasyMock.eq("OSGI-INF/remote-service"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(sdURL))).anyTimes();
        EasyMock.replay(b);
       
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.