Grails: Resource Transformation to Domain Class