| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jutil.io.fileset.FileSet
A class of objects that represent a set of files.
 
 A FileSet represents a set of files which satisfy certain criteria. In order for a file to be included, it must satisfy at least one include criterium, and may not satify any exclude criteria.
A criterium consists of a FileSetPredicate,
 which may have additional criteria embedded in itself. The FileSetPredicate is necessary in
 order to be able to provide an efficient way for calculating all the files in a FileSet.
This class was inspired by the fileset from Ant.
| Inner Class Summary | |
|  class | FileSet.FileVisitorA class of Visitors that operate on files, and can additionally perform a visit on all elements in its FileSet. | 
| Constructor Summary | |
| FileSet()Initialize a new FileSet with includes all files. Since the logical orof 0 predicates isfalse,
 the new FileSet will initially be empty. | |
| Method Summary | |
|  boolean | contains(java.io.File file)Check whether or not the given file is in this FileSet. | 
|  void | exclude(FileSetPredicate predicate)Exclude files for which the given filset predicate evaluates to truefrom this FileSet. | 
|  Or | excludePredicate()Return the predicate which should evaluate to truefor
 a file in order to be excluded in this FileSet.
 
 If you modify the predicates in the returnedOr, the behavior
 of this FileSet will also change because we cannot perform a deep clone without
 forcing all predicates to implementclone(), which is too much of
 a burden. | 
|  java.util.Set | getFiles()Return the files in this FileSet. | 
|  void | include(FileSetPredicate predicate)Include files for which the given fileset predicate evaluates to truein this FileSet. | 
|  Or | includePredicate()Return the predicate which should evaluate to truefor
 a file in order to be included in this FileSet.
 
 If you modify the predicates in the returnedOr, the behavior
 of this FileSet will also change because we cannot perform a deep clone without
 forcing all predicates to implementclone(), which is too much of
 a burden. | 
| static void | main(java.lang.String[] args) | 
|  void | removeExclude(FileSetPredicate predicate)Remove the given predicate from the exclude criteria of this FileSet. | 
|  void | removeInclude(FileSetPredicate predicate)Remove the given predicate from the include criteria of this FileSet. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public FileSet()
Initialize a new FileSet with includes all files.
Since the logical or of 0 predicates is false,
 the new FileSet will initially be empty.
| Method Detail | 
public java.util.Set getFiles()
                       throws java.lang.Exception
public void include(FileSetPredicate predicate)
Include files for which the given fileset predicate evaluates
 to true in this FileSet.
predicate - The predicate that must be added to the include
        criteria of this FileSet.public void exclude(FileSetPredicate predicate)
Exclude files for which the given filset predicate evaluates
 to true from this FileSet.
predicate - The predicate that must be added to the exclude
        criteria of this FileSet.public void removeInclude(FileSetPredicate predicate)
Remove the given predicate from the include criteria of this FileSet.
predicate - The predicate to remove from the include criteriapublic void removeExclude(FileSetPredicate predicate)
Remove the given predicate from the exclude criteria of this FileSet.
predicate - The predicate to remove from the exclude criteria
public boolean contains(java.io.File file)
                 throws java.lang.Exception
file - To file to be checked.public Or includePredicate()
Return the predicate which should evaluate to true for
 a file in order to be included in this FileSet.
If you modify the predicates in the returned Or, the behavior
 of this FileSet will also change because we cannot perform a deep clone without
 forcing all predicates to implement clone(), which is too much of
 a burden. Modifying the result itself does not affect this FileSet.
public Or excludePredicate()
Return the predicate which should evaluate to true for
 a file in order to be excluded in this FileSet.
If you modify the predicates in the returned Or, the behavior
 of this FileSet will also change because we cannot perform a deep clone without
 forcing all predicates to implement clone(), which is too much of
 a burden. Modifying the result itself does not affect this FileSet.
public static void main(java.lang.String[] args)
                 throws java.lang.Exception
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||