« Return to Thread: Load static classpath resources

Load static classpath resources

by Stan Carney-4 :: Rate this Message:

Reply to Author | View in Thread

Has anybody loaded files off the classpath in Grails before?

In Java I'm used to doing something like this:

file: com/blah/MyFile.txt

package com.blah

public class MyClass(){

    public void someting(){
       URL url = MyClass.class.getResource("/com/blah/MyFile.txt")
    }
}


Similar code in grails always returns null. I have tried
getResourceAsStream, copying the file to the root of the project, etc...
They all still return null.

Thoughts?

Stan

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Load static classpath resources