# Filter source file when copy from directory

**URL:** <https://discuss.gradle.org/t/filter-source-file-when-copy-from-directory/23175>\
**Category:** Help/Discuss\
**Created:** [July 4, 2017, 7:31am UTC](https://discuss.gradle.org/t/filter-source-file-when-copy-from-directory/23175 "2017-07-04T07:31:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Lance](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance/32/787_2.png) [@Lance](https://discuss.gradle.org/u/Lance)\
**Post date:** [July 4, 2017, 2:59pm UTC](https://discuss.gradle.org/t/filter-source-file-when-copy-from-directory/23175/3 "2017-07-04T14:59:03Z")

</div>

I always use exclusions as a last resort. Is there a chance you can split the files into two root directories instead? ie you combine the two directories (FileTrees) when you need them and don’t combine when you want the exclusion.

---

_[View the full topic](https://discuss.gradle.org/t/filter-source-file-when-copy-from-directory/23175)._
