I have a gradle project which requires some data files available somewhere on the internet using http. The goal is that this immutable remote file is pulled once upon first
How about just:
def f = new File('the file path') if (!f.exists()) { new URL('the url').withInputStream{ i -> f.withOutputStream{ it << i }} }