URL、lastModified などのフィールドを持つドメインがあります。このコードから取得した情報をリスト ページに表示したいと考えています。どうすればいいですか
def url = new URL("http://www.google.com")
HttpURLConnection connection = (HttpURLConnection)url.openConnection()
//  long contentLength = Long.parseLong(connection.getHeaderField("Content-Length"));
connection.setRequestMethod("GET")
connection.connect()
connection.getURL()
println("Date: " + new Date(connection.getDate()))
println("LastModified Date:" + new Date(connection.getLastModified()))
if (connection.responseCode == 200 || connection.responseCode == 201){
    def returnMessage = connection.content
    //print out the full response
    println "${returnMessage}";
    System.out.println(connection.getURL());
} else {
    println "Error Connecting to " + url
    println "Couldn't connect to url"
}