org.codehaus.plexus.util

Interface Scanner

public interface Scanner

Method Summary
voidaddDefaultExcludes()
Adds default exclusions to the current exclusions set.
FilegetBasedir()
Returns the base directory to be scanned.
String[]getIncludedDirectories()
Returns the names of the directories which matched at least one of the include patterns and none of the exclude patterns.
String[]getIncludedFiles()
Returns the names of the files which matched at least one of the include patterns and none of the exclude patterns.
voidscan()
Scans the base directory for files which match at least one include pattern and don't match any exclude patterns.
voidsetExcludes(String[] excludes)
Sets the list of exclude patterns to use.
voidsetIncludes(String[] includes)
Sets the list of include patterns to use.

Method Detail

addDefaultExcludes

public void addDefaultExcludes()
Adds default exclusions to the current exclusions set.

getBasedir

public File getBasedir()
Returns the base directory to be scanned. This is the directory which is scanned recursively.

Returns: the base directory to be scanned

getIncludedDirectories

public String[] getIncludedDirectories()
Returns the names of the directories which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.

Returns: the names of the directories which matched at least one of the include patterns and none of the exclude patterns.

getIncludedFiles

public String[] getIncludedFiles()
Returns the names of the files which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.

Returns: the names of the files which matched at least one of the include patterns and none of the exclude patterns.

scan

public void scan()
Scans the base directory for files which match at least one include pattern and don't match any exclude patterns.

Throws: IllegalStateException if the base directory was set incorrectly (i.e. if it is null, doesn't exist, or isn't a directory).

setExcludes

public void setExcludes(String[] excludes)
Sets the list of exclude patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not match File.separatorChar.

When a pattern ends with a '/' or '\', "**" is appended.

Parameters: 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.

setIncludes

public void setIncludes(String[] includes)
Sets the list of include patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not match File.separatorChar.

When a pattern ends with a '/' or '\', "**" is appended.

Parameters: 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.

Copyright © 2001-2010 Codehaus. All Rights Reserved.