def printDirectoryListing()

in src/main/groovy/commandLineTools/SimpleWebServer.groovy [76:84]


def printDirectoryListing(f) {
    printHeaders("text/html")          
    println "<html><head></head><body>"
    for (i in f.list().toList().sort()) {
        if ("/" == content) { content = "" } // special case for root document
        println "<a href='${content}/${i}'>${i}</a><br>"
    }
    println "</body></html>"
}