# Copy Files using Wildcard

**URL:** <https://discuss.gradle.org/t/copy-files-using-wildcard/27708>\
**Category:** Help/Discuss\
**Created:** [July 12, 2018, 1:47pm UTC](https://discuss.gradle.org/t/copy-files-using-wildcard/27708 "2018-07-12T13:47:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mclark](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@mclark](https://discuss.gradle.org/u/mclark)\
**Post date:** [July 12, 2018, 1:47pm UTC](https://discuss.gradle.org/t/copy-files-using-wildcard/27708/1 "2018-07-12T13:47:44Z")

</div>

Hi… I am new to gradle and have a build script that runs another task to copy some of the Swagger API and Contracts. My question is “Is there a way to include files that follow a certain pattern with use of wildcards?”

include ‘**/contracts/\*.java’  
include '**/api/test1Api.java’  
include ‘**/api/test2Api.java’  
include '**/api/test3SearchApi.java’

I have tried :  
include ‘ **/api/\*Api.java’ but that did not work. If I use '** /api/\*.java’ it will work, but it pulls in all of the files that were generated - controllers, api, etc.

Thanks in advanced for any help.
