public class FileSourceProvider extends SourceProvider
Constructor and Description |
---|
FileSourceProvider(StreamSourceFormat sourceFormat,
Fileset sourceFileset,
Boolean combineFiles)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SourceProvider |
copy()
Returns a copy of this source provider in its initial state.
|
void |
copyNotSetSettingsFrom(SourceProvider sourceProvider)
Copies settings which are not set in this source provider from another
source provider.
|
Boolean |
getCombineFiles()
Returns whether source files are combined into one source tree.
|
List<File> |
getPaths()
Returns all paths in the source Fileset.
|
Fileset |
getSourceFileset()
Returns the fileset which determines the source files to read.
|
StreamSourceFormat |
getSourceFormat()
Returns the source format for this provider.
|
boolean |
hasNext() |
protected void |
initInternal(ConfigurationHandlers configurationHandlers,
ControllerState controllerState)
Determines the files which match the source fileset.
|
Source |
next() |
void |
remove() |
void |
resetInternal(ConfigurationHandlers configurationHandlers,
ControllerState controllerState)
Resets the sources provided by this SourceProvider.
|
void |
setSourceFileset(Fileset sourceFileset)
Sets the fileset which determines the source files to read.
|
String |
toString() |
init, isInit, reset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEachRemaining
public FileSourceProvider(StreamSourceFormat sourceFormat, Fileset sourceFileset, Boolean combineFiles) throws ConfigurationException
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.IllegalArgumentException
- if the source type is unknown.NullPointerException
- if path is null.ConfigurationException
- if the source filter cannot be
instantiated.protected void initInternal(ConfigurationHandlers configurationHandlers, ControllerState controllerState) throws ConfigurationException
initInternal
in class SourceProvider
configurationHandlers
- the configuration handlers, not null.controllerState
- the current controller state, not null.ConfigurationException
- if the sourceFileset has no basedir or
if the files cannot be determined.public void resetInternal(ConfigurationHandlers configurationHandlers, ControllerState controllerState)
SourceProvider
resetInternal
in class SourceProvider
configurationHandlers
- the configuration handlers, not null.controllerState
- the current controller state, not null.public boolean hasNext()
public Source next()
public void remove()
public StreamSourceFormat getSourceFormat()
public Fileset getSourceFileset()
public void setSourceFileset(Fileset sourceFileset)
sourceFileset
- the new source fileset, not null.NullPointerException
- if sourceFileset is null.IllegalStateException
- if init() was called before.public List<File> getPaths()
IllegalStateException
- if the init method was not yet called.public Boolean getCombineFiles()
public SourceProvider copy() throws ConfigurationException
SourceProvider.init(ConfigurationHandlers, ControllerState)
method of the new source provider must be called before it can be used.copy
in class SourceProvider
ConfigurationException
- if the new SourceProvider cannot
be initialized.public void copyNotSetSettingsFrom(SourceProvider sourceProvider)
copyNotSetSettingsFrom
in class SourceProvider
sourceProvider
- the source provoder to copy the settings from.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.