use of org.gradle.api.internal.file.DefaultFileTreeElement in project gradle by gradle.
the class DirectoryTrees method contains.
public static boolean contains(FileSystem fileSystem, DirectoryTree tree, File file) {
String prefix = tree.getDir().getAbsolutePath() + File.separator;
if (!file.getAbsolutePath().startsWith(prefix)) {
return false;
}
RelativePath path = RelativePath.parse(true, file.getAbsolutePath().substring(prefix.length()));
return tree.getPatterns().getAsSpec().isSatisfiedBy(new DefaultFileTreeElement(file, path, fileSystem, fileSystem));
}
Aggregations