It’s often useful to fetch data from a web service and cache it in your local directory. This cuts down on the amount of traffic between your machine and the web service you’re invoking, and it makes unit testing your code easier. In this example, we’ll fetch data for 3 genes and write it out as XML files.
import org.biogroovy.io.eutils.EntrezGeneSlurper;
import org.biogroovy.models.Gene;
@Grab(group='org.biogroovy', module='biogroovy', version='1.1')
EntrezGeneSlurper slurper = new EntrezGeneSlurper();
File dir = new File(System.getProperty('user.home'), 'biogroovy_test_files');
dir.mkdirs()
slurper.fetchAsFile(dir, "675,1034,133")
// double check that the files were written out
dir.list().each{println it}

Is BioGroovy available on GitHub?
BioGroovy is a BitBucket project. You can find the code and documentation for it here. https://bitbucket.org/biogroovy/biogroovy