Getting resource from classpath in Config.groovy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting resource from classpath in Config.groovy

micke_
Hi

I've been trying to load up txt and properties files from the classpath in Config.groovy but not sure how, keep getting null back.

Basically what I'm trying to do is for dev to lookup a classpath resource, but on prod I will access a http resource. On dev I just want to fake the data.

What I'm currently doing is using user.dir and appending the path to the file in the src dir, but I'd prefer to load it from the classpath.

Cheers,
 Micke