public class SourceFileScanner extends java.lang.Object implements ResourceFactory
The only method returns an array of source files. The array is a subset of the files given as a parameter and holds only those that are newer than their corresponding target files.
Constructor and Description |
---|
SourceFileScanner(Task task)
Construct a new SourceFileScanner.
|
Modifier and Type | Method and Description |
---|---|
Resource |
getResource(java.lang.String name)
Returns resource information for a file at destination.
|
java.lang.String[] |
restrict(java.lang.String[] files,
java.io.File srcDir,
java.io.File destDir,
FileNameMapper mapper)
Restrict the given set of files to those that are newer than
their corresponding target files.
|
java.lang.String[] |
restrict(java.lang.String[] files,
java.io.File srcDir,
java.io.File destDir,
FileNameMapper mapper,
long granularity)
Restrict the given set of files to those that are newer than
their corresponding target files.
|
java.io.File[] |
restrictAsFiles(java.lang.String[] files,
java.io.File srcDir,
java.io.File destDir,
FileNameMapper mapper)
Convenience layer on top of restrict that returns the source
files as File objects (containing absolute paths if srcDir is
absolute).
|
java.io.File[] |
restrictAsFiles(java.lang.String[] files,
java.io.File srcDir,
java.io.File destDir,
FileNameMapper mapper,
long granularity)
Convenience layer on top of restrict that returns the source
files as File objects (containing absolute paths if srcDir is
absolute).
|
protected Task task
public SourceFileScanner(Task task)
task
- The task we should log messages through.public java.lang.String[] restrict(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper)
files
- the original set of files.srcDir
- all files are relative to this directory.destDir
- target files live here. if null file names
returned by the mapper are assumed to be absolute.mapper
- knows how to construct a target file names from
source file names.public java.lang.String[] restrict(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper, long granularity)
files
- the original set of files.srcDir
- all files are relative to this directory.destDir
- target files live here. If null file names
returned by the mapper are assumed to be absolute.mapper
- knows how to construct a target file names from
source file names.granularity
- The number of milliseconds leeway to give
before deciding a target is out of date.public java.io.File[] restrictAsFiles(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper)
files
- the original set of files.srcDir
- all files are relative to this directory.destDir
- target files live here. If null file names
returned by the mapper are assumed to be absolute.mapper
- knows how to construct a target file names from
source file names.public java.io.File[] restrictAsFiles(java.lang.String[] files, java.io.File srcDir, java.io.File destDir, FileNameMapper mapper, long granularity)
files
- the original set of files.srcDir
- all files are relative to this directory.destDir
- target files live here. If null file names
returned by the mapper are assumed to be absolute.mapper
- knows how to construct a target file names from
source file names.granularity
- The number of milliseconds leeway to give
before deciding a target is out of date.public Resource getResource(java.lang.String name)
getResource
in interface ResourceFactory
name
- relative path of file at destination.