org.apache.tamaya.resource.internal

## Class ClasspathCollector

- java.lang.Object
- - org.apache.tamaya.resource.internal.ClasspathCollector

-     public class ClasspathCollector
      extends Object

  Collector that searches files based on ant styled patterns. For example the following patterns would be matched:

           classpath:javax/annotations/*
           javax?/annotations/**/*.class
           org/apache/tamaya/**/tamayaconfig.properties

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CLASSPATH_PREFIX` Prefix used for explicitly selecting this collector.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClasspathCollector(ClassLoader classLoader)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<URL>` | `collectFiles(String expression)` Collect all classpath resources given the expression.
    `protected Collection<URL>` | `doFindPathMatchingJarResources(URL rootDirResource, String subPattern)` Find all resources in jar files that match the given location pattern via the Ant-style PathMatcher.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CLASSPATH_PREFIX

          public static final String CLASSPATH_PREFIX

      Prefix used for explicitly selecting this collector.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClasspathCollector

          public ClasspathCollector(ClassLoader classLoader)

      Creates a new instance.
      Parameters:
        `classLoader` - the class loader to be used, not null.

  - ### Method Detail

    - #### collectFiles

          public Collection<URL> collectFiles(String expression)

      Collect all classpath resources given the expression.
      Parameters:
        `expression` - the expression, not null.
      Returns:
        the resources found.

    - #### doFindPathMatchingJarResources

          protected Collection<URL> doFindPathMatchingJarResources(URL rootDirResource,
                                                                   String subPattern)
                                                            throws IOException,
                                                                   URISyntaxException

      Find all resources in jar files that match the given location pattern via the Ant-style PathMatcher.
      Parameters:
        `rootDirResource` - the root directory as Resource
        `subPattern` - the sub pattern to match (below the root directory)
      Returns:
        the Set of matching Resource instances
      Throws:
        `IOException` - in case of I/O errors
        `URISyntaxException`
      See Also:
        `JarURLConnection`

Copyright © 2014–2015 Apache Software Foundation. All rights reserved.