The files in one of our servers can be accessed via http. So, when we bring up a url similar to the following, we get a list of files/directories in that location:
Another version of @tim_yates Answer using JSoup
@Grab(group='org.jsoup', module='jsoup', version='1.7.3')
import org.jsoup.Jsoup
def (doc,files, dirs) = [Jsoup.connect('http://central.maven.org/maven2/com/bloidonia/groovy-stream/').get(),[],[]]
doc.select("pre > a").each{href ->
def filename = href.text()
filename.endsWith("/")?dirs.add(filename):files.add(filename)
}
println """DIRECTORIES :
${dirs.join('\n')}
FILES :
${files.join('\n')}
"""