mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 00:08:51 -05:00
* simplified certain scripting use-cases
This commit is contained in:
parent
811f945daf
commit
e535b692ff
@ -2,6 +2,14 @@
|
||||
-Dapplication.deployment=msi
|
||||
-Dapplication.dir="%APPDATA%\FileBot"
|
||||
|
||||
# FileBot system properties
|
||||
-DthreadPool=8
|
||||
-Dunixfs=false
|
||||
|
||||
# proxy settings
|
||||
# -Dhttp.proxyHost=localhost
|
||||
# -Dhttp.proxyPort=8888
|
||||
|
||||
# memory settings
|
||||
-Xms64m
|
||||
-Xmx512m
|
||||
|
@ -66,6 +66,7 @@ URL.metaClass.getHtml = { new XmlParser(new org.cyberneko.html.parsers.SAXParser
|
||||
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) }
|
||||
|
||||
URL.metaClass.get = { delegate.getText() }
|
||||
URL.metaClass.post = { Map parameters -> post(delegate.openConnection(), parameters) }
|
||||
|
@ -39,7 +39,7 @@ String.metaClass.pad = Number.metaClass.pad = { length = 2, padding = "0" -> del
|
||||
/**
|
||||
* Return a substring matching the given pattern or break.
|
||||
*/
|
||||
String.metaClass.match = { String pattern -> def matcher = delegate =~ pattern; if (matcher.find()) return matcher[0] else throw new Exception("Match failed") }
|
||||
String.metaClass.match = { String pattern, int matchGroup = 0 -> def matcher = delegate =~ pattern; if (matcher.find()) return matcher.group(matchGroup) else throw new Exception("Match failed") }
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user