views:

52

answers:

1

So this might be a stupid question but...

I want to package a specific WSDL file in with an EJB project within eclipse. What would be the best way to refer to this file in my code?

I would like to use a relative path but the current directory starts off in the /bin directory of my JBOSS installation. It seems like there should be a way to refer to the file in relation to the project file structure.

Any ideas?

+1  A: 

getClass().getResource(String path) uses a relative path to locate a classpath resource. It returns a java.net.URL. Alternatively, you can use getResourceAsStream(..) to obtain the InputStream to the resource.

Bozho