Package org.apache.commons.discovery

Examples of org.apache.commons.discovery.ResourceIterator.nextResource()


        DiscoverResources disc = new DiscoverResources();
        disc.addClassLoader(JDKHooks.getJDKHooks().getThreadContextClassLoader());
        disc.addClassLoader(loader);
        ResourceIterator iterator = disc.findResources(location);
        if (iterator.hasNext()) {
            Resource resource = iterator.nextResource();
            is = resource.getResourceAsStream();
        }

        /**
         * If we don't find it, then look on the file system.
View Full Code Here


        DiscoverResources disc = new DiscoverResources();
        disc.addClassLoader(JDKHooks.getJDKHooks().getThreadContextClassLoader());
        disc.addClassLoader(this.getClass().getClassLoader());
        ResourceIterator iterator = disc.findResources(location);
        if (iterator.hasNext()) {
            Resource resource = iterator.nextResource();
            is = resource.getResourceAsStream();
        }
       
        /**
         * If we don't find it, then look on the file system.
View Full Code Here

                disc.addClassLoader(classLoader);

                ResourceIterator iterator = disc
                        .findResources(keyStorelocation);
                if (iterator.hasNext()) {
                    Resource resource = iterator.nextResource();
                    is = resource.getResourceAsStream();
                }

                if (is == null) {
                    iterator = disc.findResources("META-INF/"
View Full Code Here

                if (is == null) {
                    iterator = disc.findResources("META-INF/"
                            + keyStorelocation);
                    if (iterator.hasNext()) {
                        Resource resource = iterator.nextResource();
                        is = resource.getResourceAsStream();
                    }
                }
            }
            if (is == null) {
View Full Code Here

                return className;
            }

            private List<String> getNextClassNames() {
                while (files.hasNext()) {
                    List<String> results = readServices(files.nextResource());
                    if (results != null  &&  results.size() > 0) {
                        return results;
                    }
                }
                return null;
View Full Code Here

            resourceName = getPackageName(spi).replace('.','/') + "/" + resourceName;
            resources = explorer.findResources(resourceName);
        }

        return resources.hasNext()
               ? resources.nextResource()
               : null;
    }

    /**
     * Load named property file, optionally qualified by spi's package name
View Full Code Here

        DiscoverResources discovery = new DiscoverResources(loaders);
        ResourceIterator iter = discovery.findResources(name);
        int count = 0;
       
        while (iter.hasNext()) {
            Resource resource = iter.nextResource();
            URL url = resource.getResource();
            if ( url != null ) {
                if (url.getFile().indexOf(partialPaths[count]) == -1) {
                    fail(url + " does not contain " + partialPaths[count]);
                }
View Full Code Here

            resourceName = getPackageName(spi).replace('.','/') + "/" + resourceName;
            resources = explorer.findResources(resourceName);
        }
       
        return resources.hasNext()
               ? resources.nextResource()
               : null;
    }
   
    /**
     * Load named property file, optionally qualifed by spi's package name
View Full Code Here

                return className;
            }

            private Vector getNextClassNames() {
                while (files.hasNext()) {
                    Vector results = readServices(files.nextResource());
                    if (results != null  &&  results.size() > 0) {
                        return results;
                    }
                }
                return null;
View Full Code Here

        DiscoverResources discovery = new DiscoverResources(loaders);
        ResourceIterator iter = discovery.findResources(name);
        int count = 0;

        while (iter.hasNext()) {
            Resource resource = iter.nextResource();
            URL url = resource.getResource();
            if (url != null) {
                if (url.getFile().indexOf(partialPaths[count]) == -1) {
                    fail(url + " does not contain " + partialPaths[count]);
                }
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.