Class 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
    • 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 -
      • 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