public class WagonDirectoryScanner extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
DEFAULTEXCLUDES
Patterns which should be excluded by default.
|
Constructor and Description |
---|
WagonDirectoryScanner() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultExcludes()
Adds default exclusions to the current exclusions set.
|
protected boolean |
couldHoldIncluded(String name)
Tests whether or not a name matches the start of at least one include pattern.
|
List |
getFilesIncluded() |
org.apache.maven.plugin.logging.Log |
getLogger() |
protected boolean |
isExcluded(String name)
Tests whether or not a name matches against at least one exclude pattern.
|
protected static boolean |
matchPatternStart(String pattern,
String str,
boolean isCaseSensitive)
Tests whether or not a given path matches the start of a given pattern up to the first "**".
|
void |
scan() |
void |
setCaseSensitive(boolean isCaseSensitive) |
void |
setDirectory(String basePath) |
void |
setExcludes(String[] excludes)
Sets the list of exclude patterns to use.
|
void |
setIncludes(String[] includes)
Sets the list of include patterns to use.
|
void |
setLogger(org.apache.maven.plugin.logging.Log logger) |
void |
setWagon(org.apache.maven.wagon.Wagon wagon) |
public static final String[] DEFAULTEXCLUDES
addDefaultExcludes()
public void setIncludes(String[] includes)
File.separatorChar
, so the separator used need not match File.separatorChar
.
When a pattern ends with a '/' or '\', "**" is appended.
includes
- A list of include patterns. May be null
, indicating that all files should be
included. If a non-null
list is given, all elements must be non-null
.public void setExcludes(String[] excludes)
When a pattern ends with a '/' or '\', "**" is appended.
excludes
- A list of exclude patterns. May be null
, indicating that no files should be
excluded. If a non-null
list is given, all elements must be non-null
.protected boolean isExcluded(String name)
name
- The name to match. Must not be null
.true
when the name matches against at least one exclude pattern, or false
otherwise.protected boolean couldHoldIncluded(String name)
name
- The name to match. Must not be null
.true
when the name matches against the start of at least one include pattern, or
false
otherwise.protected static boolean matchPatternStart(String pattern, String str, boolean isCaseSensitive)
This is not a general purpose test and should only be used if you can live with false positives. For example,
pattern=**\a
and str=b
will yield true
.
pattern
- The pattern to match against. Must not be null
.str
- The path to match, as a String. Must not be null
.isCaseSensitive
- Whether or not matching should be performed case sensitively.public void scan() throws org.apache.maven.wagon.WagonException
org.apache.maven.wagon.WagonException
public void addDefaultExcludes()
public List getFilesIncluded()
public void setWagon(org.apache.maven.wagon.Wagon wagon)
public void setCaseSensitive(boolean isCaseSensitive)
public void setDirectory(String basePath)
public org.apache.maven.plugin.logging.Log getLogger()
public void setLogger(org.apache.maven.plugin.logging.Log logger)
Copyright © 2008–2021 MojoHaus. All rights reserved.