* added helpers for xml processing
This commit is contained in:
parent
c0a9d70d5d
commit
02b2317f89
|
@ -63,10 +63,12 @@ import static net.sourceforge.filebot.web.WebRequest.*
|
|||
|
||||
URL.metaClass.getText = { readAll(getReader(delegate.openConnection())) }
|
||||
URL.metaClass.getHtml = { new XmlParser(new org.cyberneko.html.parsers.SAXParser()).parseText(delegate.getText()) }
|
||||
URL.metaClass.getXml = { new XmlParser().parseText(delegate.getText()) }
|
||||
URL.metaClass.fetch = { fetch(delegate) }
|
||||
ByteBuffer.metaClass.getText = { csn = "utf-8" -> Charset.forName(csn).decode(delegate.duplicate()).toString() }
|
||||
ByteBuffer.metaClass.getHtml = { csn = "utf-8" -> new XmlParser(new org.cyberneko.html.parsers.SAXParser()).parseText(delegate.getText(csn)) }
|
||||
String.metaClass.getHtml = { new XmlParser(new org.cyberneko.html.parsers.SAXParser()).parseText(delegate) }
|
||||
String.metaClass.getXml = { new XmlParser().parseText(delegate) }
|
||||
|
||||
URL.metaClass.get = { delegate.getText() }
|
||||
URL.metaClass.post = { Map parameters -> post(delegate.openConnection(), parameters) }
|
||||
|
|
Loading…
Reference in New Issue