Configure deployable file

I am trying to deploy a file which I download from repository. I will not be able to guess the version of file that is being downloaded before hand. So how do I refer this file explicitly?

Ex: The file I download from repository looks like myfile-1.0.134243.war. I wont be able to explicitly refer this file as file = file("${buildDir}/repo/myfile-1.0.134243.war") since I have no clue about the version.

This is how my configuration looks like now.

cargo {
   containerId = 'tomcat7x'
   port = 8080
   deployable {
       file = file("${buildDir}/repo").listFiles()[0]
       context = "${project.name}"
    }
    remote {
       hostname = "mytomcatserver"
       username = "${tomcat_username}"
       password = "${tomcat_password}"
       timeout = 6000
    }
}

How do files get into build/repo? from another task?

I download it from repository by using RESTAPI. Where the build number and job name are the parameters for downloading them.