# Re: How to create an empty fileTree?

**URL:** <https://discuss.gradle.org/t/re-how-to-create-an-empty-filetree/14362>\
**Category:** Help/Discuss\
**Created:** [February 9, 2016, 7:20pm UTC](https://discuss.gradle.org/t/re-how-to-create-an-empty-filetree/14362 "2016-02-09T19:20:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lance\_Java](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance_java/32/787_2.png) [@Lance\_Java](https://discuss.gradle.org/u/Lance_Java)\
**Post date:** [February 9, 2016, 7:20pm UTC](https://discuss.gradle.org/t/re-how-to-create-an-empty-filetree/14362/1 "2016-02-09T19:20:56Z")

</div>

Continuing the discussion from [How to create an empty fileTree?](https://discuss.gradle.org/t/how-to-create-an-empty-filetree/7113/8):

FYI - I managed to solve this by appending FileTree instances to an empty FileCollection

eg:

```gradle
def allFiles = files()
["one", "two", "three"].each {
   allFiles += fileTree(it)
}
doStuff(allFiles)

```

---

<div class="post-metadata">

**Author:** ![mark\_vieira](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_vieira/32/5396_2.png) [@mark\_vieira](https://discuss.gradle.org/u/mark_vieira)\
**Post date:** [February 10, 2016, 3:30am UTC](https://discuss.gradle.org/t/re-how-to-create-an-empty-filetree/14362/2 "2016-02-10T03:30:15Z")

</div>

You should actually simply be able to do the following:

```
def tree = files().asFileTree
```
