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 compoundTestResourceProvider
, 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 aFilesystemTestResourceProvider
and anArchiveTestResourceProvider
, 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(java.util.Collection<? extends java.io.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(java.io.File anArchiveFile, boolean aRecursiveFlag)
Adds the given archive file resource.void
addRecursively(java.io.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(java.io.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
-
-
-
-
Method Detail
-
addRecursively
public void addRecursively(java.io.File aResourceFile) throws java.io.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:
java.io.IOException
-
addAllRecursively
public void addAllRecursively(java.util.Collection<? extends java.io.File> someResourceFiles) throws java.io.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:
java.io.IOException
-
addScriptFile
public void addScriptFile(java.io.File aResourceFile)
Adds the given resource if it is a plain script file. The file will only be added if it ends with theAbstractTestResourceProvider.INTEGRITY_TEST_FILES_SUFFIX
suffix!- Parameters:
aResourceFile
- the resource file to add
-
addArchiveFile
public void addArchiveFile(java.io.File anArchiveFile, boolean aRecursiveFlag) throws java.io.IOException
Adds the given archive file resource. This automatically adds all Integrity scripts (ending on theAbstractTestResourceProvider.INTEGRITY_TEST_FILES_SUFFIX
suffix) within this archive.- Parameters:
anArchiveFile
- the archive to addaRecursiveFlag
- whether archives inside archives shall be searched too- Throws:
java.io.IOException
-
-