Package de.gebit.integrity.runner.providers

## Class AbstractCompoundTestResourceProvider

- java.lang.Object
- - de.gebit.integrity.runner.providers.AbstractCompoundTestResourceProvider

- All Implemented Interfaces:
    `TestResourceProvider`
  Direct Known Subclasses:
    `FilesystemArchiveTestResourceProvider`

      public abstract class AbstractCompoundTestResourceProvider
      extends Object
      implements TestResourceProvider

  A `AbstractCompoundTestResourceProvider` wraps one or multiple other `TestResourceProvider` instances.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected List<TestResourceProvider>` | `resourceProviders` | The resource providers wrapped by this compound provider.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `AbstractCompoundTestResourceProvider​(TestResourceProvider... someProviders)` | Creates a new compound provider, wrapping the given resource providers.
    `protected` | `AbstractCompoundTestResourceProvider​(List<TestResourceProvider> someProviders)` | Creates a new compound provider, wrapping the given resource providers.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `closeResource​(TestResource aResourceName, InputStream aResourceStream)` | Closes a specified resources' stream (and all the stuff opened for this stream in the background).
    `protected <T extends TestResourceProvider> T` | `findProvider​(Class<T> aProviderClass)` | Finds a specific provider instance by its type.
    `ClassLoader` | `getClassLoader()` | Returns the classloader to use for all dynamic class resolving needs.
    `TestResource[]` | `getResourceNames()` | Returns all known resource names.
    `InputStream` | `openResource​(TestResource aResourceName)` | Opens a specific named resource.

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

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

- - ### Field Detail

    - #### resourceProviders

          protected List<TestResourceProvider> resourceProviders

      The resource providers wrapped by this compound provider.

  - ### Constructor Detail

    - #### AbstractCompoundTestResourceProvider

          protected AbstractCompoundTestResourceProvider​(List<TestResourceProvider> someProviders)

      Creates a new compound provider, wrapping the given resource providers.
      Parameters:
        `someProviders` - the providers to wrap

    - #### AbstractCompoundTestResourceProvider

          protected AbstractCompoundTestResourceProvider​(TestResourceProvider... someProviders)

      Creates a new compound provider, wrapping the given resource providers.
      Parameters:
        `someProviders` - the providers to wrap

  - ### Method Detail

    - #### getResourceNames

          public TestResource[] getResourceNames()

      Description copied from interface: `TestResourceProvider`
      Returns all known resource names.
      Specified by:
        `getResourceNames` in interface `TestResourceProvider`
      Returns:

    - #### openResource

          public InputStream openResource​(TestResource aResourceName)
                                   throws IOException

      Description copied from interface: `TestResourceProvider`
      Opens a specific named resource. This should return an `InputStream` at the start of the data of the respective resources, and it is only expected to work if the resource is one of those enumerated by a call to `TestResourceProvider.getResourceNames()`.
      Specified by:
        `openResource` in interface `TestResourceProvider`
      Parameters:
        `aResourceName` - the resource to be opened
      Returns:
        an `InputStream` to read the resource
      Throws:
        `IOException`

    - #### closeResource

          public void closeResource​(TestResource aResourceName,
                                    InputStream aResourceStream)
                             throws IOException

      Description copied from interface: `TestResourceProvider`
      Closes a specified resources' stream (and all the stuff opened for this stream in the background).
      Specified by:
        `closeResource` in interface `TestResourceProvider`
      Parameters:
        `aResourceName` - the resource to be closed
        `aResourceStream` - the resource stream to close
      Throws:
        `IOException`

    - #### getClassLoader

          public ClassLoader getClassLoader()

      Description copied from interface: `TestResourceProvider`
      Returns the classloader to use for all dynamic class resolving needs.
      Specified by:
        `getClassLoader` in interface `TestResourceProvider`
      Returns:
        the classloader to use

    - #### findProvider

          protected <T extends TestResourceProvider> T findProvider​(Class<T> aProviderClass)

      Finds a specific provider instance by its type.
      Parameters:
        `aProviderClass` - the providers' class
      Returns:
        the first instance matching the type