Package org.apache.commons.discovery.resource

Examples of org.apache.commons.discovery.resource.DiscoverResources.find()


    {
        FirstResourceListener listener = new FirstResourceListener();
       
        DiscoverResources explorer = new DiscoverResources(loaders);
        explorer.setListener(listener);
        explorer.find(resourceName);
       
        if (spi != null  &&
            (listener.getFirst() == null&&
            resourceName.charAt(0) != '/')
        {
View Full Code Here


            /**
             * If we didn't find the resource, and if the resourceName
             * isn't an 'absolute' path name, then qualify with
             * package name of the spi.
             */
            explorer.find(getPackageName(spi).replace('.','/') + "/" + resourceName);
        }
       
        return listener.getFirst();
    }
   
View Full Code Here

        GatherResourcesListener listener = new GatherResourcesListener();
        DiscoverResources disc = new DiscoverResources();
        disc.addClassLoader( JDKHooks.getJDKHooks().getThreadContextClassLoader() );
        disc.addClassLoader( this.getClass().getClassLoader() );
        disc.setListener(listener);
        disc.find(name);

        Vector vector = listener.getResources();
        drivers = new String[vector.size()];
        for (int i = 0; i < vector.size(); i++) {
            drivers[i] = ((Resource)vector.get(i)).getName();
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.