Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Trying to make this snippet more Groovy

SophosGuy

2008-08-14

Replies: Find Java Web Hosting

Author LoginPost Reply

Hey everyone can someone help me make this Groovy? I wouldn't mind someone
showing me how to create an XML slurper with BufferedReader

static String getRecord(Number)
  {
    String requestString =
"http://url/fs-xwc?query=srw.no+%3D+%22${Number}%22
&recordSchema=info:srw/schema/1/CDFXMLWORK"
    URL url = new URL(requestString)
    HttpURLConnection conn = (HttpURLConnection)url.openConnection()
    conn.setRequestMethod("GET");
    conn.setRequestProperty( "Content-type", "text/xml" );
    BufferedReader bfr = new BufferedReader(new
InputStreamReader(conn.getInputStream()))
    String inputLine
    Boolean foundCDFLine = false
    while ( (inputLine = bfr.readLine()) != null)
    {
       //if (inputLine.contains("<CDFRec xmlns="">"))
       //System.out.println(inputLine)
    }  
  }
--
Sent from the groovy - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.