public class FileSet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.nio.file.Path |
directory |
java.util.Set<java.util.regex.Pattern> |
excludePatterns |
java.util.Set<java.util.regex.Pattern> |
includePatterns |
static java.util.Set<java.lang.String> |
REQUIRED_ATTRIBUTES |
static java.util.Set<java.lang.String> |
VALID_ATTRIBUTES |
Constructor and Description |
---|
FileSet(java.nio.file.Path directory)
Constructs a new FileSet.
|
FileSet(java.nio.file.Path directory,
java.util.Collection<java.util.regex.Pattern> includePatterns,
java.util.Collection<java.util.regex.Pattern> excludePatterns)
Constructs a new FileSet.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
attributesValid(java.util.Map<java.lang.String,java.lang.Object> attributes)
Determines if the attributes given can be used to construct a FileSet.
|
static FileSet |
fromAttributes(java.nio.file.Path dir,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Constructs a FileSet from a Map of attributes.
|
java.util.Set<Directory> |
toDirectories()
Builds the set of directories that all of the files in this FileSet are contained within.
|
java.util.List<FileInfo> |
toFileInfos()
Converts this FileSet to a list of FileInfo objects.
|
FileSet |
withExcludePatterns(java.util.List<java.util.regex.Pattern> excludePatterns)
Sets the excludePatterns.
|
FileSet |
withIncludePatterns(java.util.List<java.util.regex.Pattern> includePatterns)
Sets the includePatterns.
|
public static final java.util.Set<java.lang.String> REQUIRED_ATTRIBUTES
public static final java.util.Set<java.lang.String> VALID_ATTRIBUTES
public final java.nio.file.Path directory
public final java.util.Set<java.util.regex.Pattern> excludePatterns
public final java.util.Set<java.util.regex.Pattern> includePatterns
public FileSet(java.nio.file.Path directory)
directory
- The directory of the FileSet.public FileSet(java.nio.file.Path directory, java.util.Collection<java.util.regex.Pattern> includePatterns, java.util.Collection<java.util.regex.Pattern> excludePatterns)
directory
- The directory of the FileSet.includePatterns
- (Optional) A list of regular expression Pattern objects that list the files to include.excludePatterns
- (Optional) A list of regular expression Pattern objects that list the files to exclude.public static java.lang.String attributesValid(java.util.Map<java.lang.String,java.lang.Object> attributes)
attributes
- The attributes.public static FileSet fromAttributes(java.nio.file.Path dir, java.util.Map<java.lang.String,java.lang.Object> attributes)
dir
- The directory for the FileSet.attributes
- The attributes.public java.util.Set<Directory> toDirectories() throws java.io.IOException
java.io.IOException
- If the build fails.public java.util.List<FileInfo> toFileInfos() throws java.io.IOException
java.io.IOException
- If the directory traversal fails.public FileSet withExcludePatterns(java.util.List<java.util.regex.Pattern> excludePatterns)
excludePatterns
- The excludePatterns.public FileSet withIncludePatterns(java.util.List<java.util.regex.Pattern> includePatterns)
includePatterns
- The includePatterns.