Package de.gebit.integrity.runner.providers

## Class FilesystemTestResourceProvider

- java.lang.Object
- - de.gebit.integrity.runner.providers.AbstractTestResourceProvider
  - - de.gebit.integrity.runner.providers.FilesystemTestResourceProvider

- All Implemented Interfaces:
    `TestResourceProvider`

      public class FilesystemTestResourceProvider
      extends AbstractTestResourceProvider

  A resource provider which reads test files from the filesystem, either from one or more flat directories or optionally in a recursive way.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    - ### Fields inherited from class de.gebit.integrity.runner.providers.AbstractTestResourceProvider

      `INTEGRITY_TEST_FILES_SUFFIX, resourceFiles`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FilesystemTestResourceProvider()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAllRecursively​(Collection<? extends File> someResourceFiles)` | Adds the given resources recursively, that is if one of them is a directory all enclosed directories and files of it are recursively included as well.
    `void` | `addFile​(File aResourceFile)` | Adds the given resource if it is a file.
    `void` | `addRecursively​(File aResourceFile)` | Adds the given resource recursively, that is if it is a directory all enclosed directories and files are recursively included as well.
    `void` | `closeResource​(TestResource aResourceName, InputStream aResourceStream)` | Closes a specified resources' stream (and all the stuff opened for this stream in the background).
    `InputStream` | `openResource​(TestResource aResourceName)` | Opens a specific named resource.

    - ### Methods inherited from class de.gebit.integrity.runner.providers.AbstractTestResourceProvider

      `addResource, createAndAddResource, createResource, getClassLoader, getResourceNames, setClassLoader`

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

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

- - ### Constructor Detail

    - #### FilesystemTestResourceProvider

          public FilesystemTestResourceProvider()

  - ### Method Detail

    - #### addRecursively

          public void addRecursively​(File aResourceFile)

      Adds the given resource recursively, that is if it is a directory all enclosed directories and files are recursively included as well.
      Parameters:
        `aResourceFile` - Resource to be added.

    - #### addAllRecursively

          public void addAllRecursively​(Collection<? extends File> someResourceFiles)

      Adds the given resources recursively, that is if one of them is a directory all enclosed directories and files of it are recursively included as well.
      Parameters:
        `someResourceFiles` - Resources to be added.

    - #### addFile

          public void addFile​(File aResourceFile)

      Adds the given resource if it is a file.
      Parameters:
        `aResourceFile` -

    - #### openResource

          public InputStream openResource​(TestResource aResourceName)

      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()`.
      Parameters:
        `aResourceName` - the resource to be opened
      Returns:
        an `InputStream` to read the resource

    - #### 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).
      Parameters:
        `aResourceName` - the resource to be closed
        `aResourceStream` - the resource stream to close
      Throws:
        `IOException`