Groovy web console

subscribe to the feed Subscribe
to this
File transfer (via #groovywebconsole)
tweet this snippet Tweet

File transfer

Published 1 year ago by mdemyanov with tags naumen
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def source = utils.get('sourceClass$id')
def target = utils.get('targetClass$id')
def file = utils.files(source)?.first()
def fileAttrs = [:]
fileAttrs.put('source', target.UUID)
fileAttrs.put('sourceFqn', target.metaClass.toString())
fileAttrs.put('relation', null)
utils.edit(file, fileAttrs)