Examples of findEntries()


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

    public void testMultiRemoteServicesXMLFiles() {
        URL rs1URL = getClass().getResource("/test-resources/rs1.xml");
        URL rs2URL = getClass().getResource("/test-resources/rs2.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(rs1URL, rs2URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

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

        headers.put("Remote-Service", "META-INF/osgi");
        headers.put("Bundle-Name", "testing bundle");
       
        Bundle b = EasyMock.createNiceMock(Bundle.class);
        EasyMock.expect(b.getHeaders()).andReturn(headers).anyTimes();
        EasyMock.expect(b.findEntries(
            EasyMock.eq("META-INF/osgi"),
            EasyMock.eq("*.xml"), EasyMock.anyBoolean())).andReturn(
                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
View Full Code Here

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

        }

        @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

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

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

        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

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

            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

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

      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

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

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

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

   
    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

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

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