Class FileSourceProvider

  • All Implemented Interfaces:
    Iterator<Source>

    public class FileSourceProvider
    extends SourceProvider
    Contains sources which are read from files in the file system. $Id: FileSourceProvider.java 1839288 2018-08-27 09:48:33Z tv $
    • Constructor Detail

      • FileSourceProvider

        public FileSourceProvider​(StreamSourceFormat sourceFormat,
                                  Fileset sourceFileset,
                                  Boolean combineFiles)
                           throws ConfigurationException
        Constructor.
        Parameters:
        sourceFormat - the source format, or null if the source format should be determined from the file extension.
        sourceFileset - the fileset defining the source files, not null.
        combineFiles - whether all files should be combined into one source tree.
        Throws:
        IllegalArgumentException - if the source type is unknown.
        NullPointerException - if path is null.
        ConfigurationException - if the source filter cannot be instantiated.
    • Method Detail

      • resetInternal

        public void resetInternal​(ConfigurationHandlers configurationHandlers,
                                  ControllerState controllerState)
        Description copied from class: SourceProvider
        Resets the sources provided by this SourceProvider.
        Specified by:
        resetInternal in class SourceProvider
        Parameters:
        configurationHandlers - the configuration handlers, not null.
        controllerState - the current controller state, not null.
      • hasNext

        public boolean hasNext()
      • remove

        public void remove()
      • getSourceFormat

        public StreamSourceFormat getSourceFormat()
        Returns the source format for this provider.
        Returns:
        the source format, or null if the format is determined from file extensions.
      • getSourceFileset

        public Fileset getSourceFileset()
        Returns the fileset which determines the source files to read.
        Returns:
        the fileset which determines the source files to read.
      • setSourceFileset

        public void setSourceFileset​(Fileset sourceFileset)
        Sets the fileset which determines the source files to read.
        Parameters:
        sourceFileset - the new source fileset, not null.
        Throws:
        NullPointerException - if sourceFileset is null.
        IllegalStateException - if init() was called before.
      • getPaths

        public List<File> getPaths()
        Returns all paths in the source Fileset. The method init() must be called beforehand.
        Returns:
        all Paths in the source fileset, not null.
        Throws:
        IllegalStateException - if the init method was not yet called.
      • getCombineFiles

        public Boolean getCombineFiles()
        Returns whether source files are combined into one source tree.
        Returns:
        true if the source files are combined into one source tree, false otherwise, null to allow overriding this property (but will count as false if not overridden).
      • copyNotSetSettingsFrom

        public void copyNotSetSettingsFrom​(SourceProvider sourceProvider)
        Copies settings which are not set in this source provider from another source provider. This only works if the type of the other source provider is known to this source provider. Only a subset of all properties are typically used for overwriting. No Properties which are already set are overwritten.
        Specified by:
        copyNotSetSettingsFrom in class SourceProvider
        Parameters:
        sourceProvider - the source provoder to copy the settings from.