1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-25 01:08:52 -05:00

* auto-create folders if necessary

This commit is contained in:
Reinhard Pointner 2012-06-17 12:36:59 +00:00
parent 025970e940
commit ec5c492274

View File

@ -72,7 +72,7 @@ URL.metaClass.post = { Map parameters -> post(delegate.openConnection(), paramet
URL.metaClass.post = { byte[] data, contentType = 'application/octet-stream' -> post(delegate.openConnection(), data, contentType) } URL.metaClass.post = { byte[] data, contentType = 'application/octet-stream' -> post(delegate.openConnection(), data, contentType) }
URL.metaClass.post = { String text, csn = 'utf-8' -> delegate.post(text.getBytes(csn), 'text/plain') } URL.metaClass.post = { String text, csn = 'utf-8' -> delegate.post(text.getBytes(csn), 'text/plain') }
ByteBuffer.metaClass.saveAs = { f -> f = f as File; writeFile(delegate.duplicate(), f); f.absoluteFile }; ByteBuffer.metaClass.saveAs = { f -> f = f as File; f.parentFile.mkdirs(); writeFile(delegate.duplicate(), f); f.absoluteFile }
URL.metaClass.saveAs = { f -> fetch(delegate).saveAs(f) } URL.metaClass.saveAs = { f -> fetch(delegate).saveAs(f) }
String.metaClass.saveAs = { f, csn = "utf-8" -> Charset.forName(csn).encode(delegate).saveAs(f) } String.metaClass.saveAs = { f, csn = "utf-8" -> Charset.forName(csn).encode(delegate).saveAs(f) }