use of org.gradle.api.file.FileVisitor in project gradle by gradle.
the class AbstractFileCollection method visitAll.
/**
* Visits all the files of the given tree.
*/
protected static boolean visitAll(FileSystemMirroringFileTree tree) {
final MutableBoolean hasContent = new MutableBoolean();
tree.visit(new FileVisitor() {
@Override
public void visitDir(FileVisitDetails dirDetails) {
dirDetails.getFile();
hasContent.set(true);
}
@Override
public void visitFile(FileVisitDetails fileDetails) {
fileDetails.getFile();
hasContent.set(true);
}
});
return hasContent.get();
}
use of org.gradle.api.file.FileVisitor in project gradle by gradle.
the class FilteredMinimalFileTree method visit.
@Override
public void visit(FileVisitor visitor) {
Spec<FileTreeElement> spec = patterns.getAsSpec();
tree.visit(new FileVisitor() {
@Override
public void visitDir(FileVisitDetails dirDetails) {
if (spec.isSatisfiedBy(dirDetails)) {
visitor.visitDir(dirDetails);
}
}
@Override
public void visitFile(FileVisitDetails fileDetails) {
if (spec.isSatisfiedBy(fileDetails)) {
visitor.visitFile(fileDetails);
}
}
});
}
Aggregations