This message was deleted.
# community-support
s
This message was deleted.
t
If you want the files in a directory, then use a `FileTree`/`ConfigurableFileTree` which is then a
PatternFilterable
.
b
But FileTree does not preserve directory structure and instead flattens all files
I basically need something like CopySpec, but also acceptable as cacheable task input.
t
What do you mean by "flattens all files"? What kind of API would you like? Doesn't
visit()
of
FileTree
"preserve directory structure"?
b
I have tried
project.fileTree("src")
and it returns all files in src directory flattened with no subfolders being preserved.
t
visit()
does preserve directories though:
Copy code
project.fileTree("src").visit(object : Action<FileVisitDetails> { override fun execute(it: FileVisitDetails) { println(it.file) } })