Package de.gebit.integrity.runner.providers

## Class FilesystemArchiveTestResourceProvider

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

- All Implemented Interfaces:
    `TestResourceProvider`

      public class FilesystemArchiveTestResourceProvider
      extends AbstractCompoundTestResourceProvider

  This is a compound `TestResourceProvider`, able to read Integrity scripts directly from the file system, within a directory on the filesystem, and within archive files (and archives within archives). It wraps a `FilesystemTestResourceProvider` and an `ArchiveTestResourceProvider`, which provide the actual functionality.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

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

      `resourceProviders`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FilesystemArchiveTestResourceProvider()` | Creates a new instance.

  - ### 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` | `addArchiveFile​(File anArchiveFile, boolean aRecursiveFlag)` | Adds the given archive file resource.
    `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` | `addScriptFile​(File aResourceFile)` | Adds the given resource if it is a plain script file.

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

      `closeResource, findProvider, getClassLoader, getResourceNames, openResource`

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

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

- - ### Constructor Detail

    - #### FilesystemArchiveTestResourceProvider

          public FilesystemArchiveTestResourceProvider()

      Creates a new instance.

  - ### Method Detail

    - #### addRecursively

          public void addRecursively​(File aResourceFile)
                              throws IOException

      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. May be a script file, a directory, or an archive (ending on .zip or .jar)
      Throws:
        `IOException`

    - #### addAllRecursively

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

      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.
      Throws:
        `IOException`

    - #### addScriptFile

          public void addScriptFile​(File aResourceFile)

      Adds the given resource if it is a plain script file. The file will only be added if it ends with the `AbstractTestResourceProvider.INTEGRITY_TEST_FILES_SUFFIX` suffix!
      Parameters:
        `aResourceFile` - the resource file to add

    - #### addArchiveFile

          public void addArchiveFile​(File anArchiveFile,
                                     boolean aRecursiveFlag)
                              throws IOException

      Adds the given archive file resource. This automatically adds all Integrity scripts (ending on the `AbstractTestResourceProvider.INTEGRITY_TEST_FILES_SUFFIX` suffix) within this archive.
      Parameters:
        `anArchiveFile` - the archive to add
        `aRecursiveFlag` - whether archives inside archives shall be searched too
      Throws:
        `IOException`