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?
getClass().getResource(String path)uses a relative path to locate a classpath resource. It returns ajava.net.URL. Alternatively, you can usegetResourceAsStream(..)to obtain theInputStreamto the resource.