Package biz.gabrys.maven.plugin.util.io
Class AntFileScanner
- java.lang.Object
-
- biz.gabrys.maven.plugin.util.io.AntFileScanner
-
- All Implemented Interfaces:
FileScanner
public class AntFileScanner extends Object implements FileScanner
File scanner which uses Ant patterns to match files.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description AntFileScanner()
Constructs a new instance.AntFileScanner(Log logger)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<File>
convertToFiles(File directory, String[] paths)
Converts paths found by scanner to files collection with absolute paths.protected DirectoryScanner
createDirectoryScanner()
Creates aDirectoryScanner
which will be used to find all files whose match filters.Collection<File>
getFiles(File directory, String[] includes, String[] excludes)
Returns files contained by a directory.
-
-
-
Constructor Detail
-
AntFileScanner
public AntFileScanner()
Constructs a new instance.- Since:
- 1.2
-
AntFileScanner
public AntFileScanner(Log logger)
Constructs a new instance.- Parameters:
logger
- the logger used to log included/excluded files (only in debug mode).- Since:
- 1.2
-
-
Method Detail
-
getFiles
public Collection<File> getFiles(File directory, String[] includes, String[] excludes)
Description copied from interface:FileScanner
Returns files contained by a directory.- Specified by:
getFiles
in interfaceFileScanner
- Parameters:
directory
- the directory to be scanned.includes
- an array of include patterns.excludes
- an array of exclude patterns- Returns:
- files contained by a directory.
-
createDirectoryScanner
protected DirectoryScanner createDirectoryScanner()
Creates aDirectoryScanner
which will be used to find all files whose match filters.- Returns:
- a not initialized instance of the
DirectoryScanner
or its subclass. - Since:
- 1.3.0
- See Also:
getFiles(File, String[], String[])
-
convertToFiles
protected List<File> convertToFiles(File directory, String[] paths)
Converts paths found by scanner to files collection with absolute paths.- Parameters:
directory
- the base directory.paths
- the found paths.- Returns:
- the collection with files.
- Since:
- 1.2
- See Also:
getFiles(File, String[], String[])
-
-