Example usage for org.apache.commons.bcel6.util ClassPath toString

List of usage examples for org.apache.commons.bcel6.util ClassPath toString

Introduction

In this page you can find the example usage for org.apache.commons.bcel6.util ClassPath toString.

Prototype

@Override
public String toString() 

Source Link

Usage

From source file:ru.objective.jni.utils.ResourceList.java

/**
 * for all elements of java.class.path get a Collection of resources Pattern
 * pattern = Pattern.compile(".*"); gets all resources
 *
 * @param pattern//w w w.j ava  2s  . c o  m
 *            the pattern to match
 * @return the resources in the order they are found
 */
public static Collection<String> getResources(ClassPath classPath, final Pattern pattern) {
    final ArrayList<String> retval = new ArrayList<String>();
    final String[] classPathElements = classPath.toString().split(File.pathSeparator);
    for (final String element : classPathElements) {
        Collection<String> resources = getResources(element, pattern);

        if (resources != null)
            retval.addAll(resources);
    }
    return retval;
}