[jboss-user] [EJB 3.0] - Re: Access a file resource from EJB3.0
gmuzzillo
do-not-reply at jboss.com
Thu Oct 25 07:26:20 EDT 2007
Hi!!
Inside an EJB you can have a FileStream representation using the classloader and Threadl.
here goes a little sample:
ClassLoader loader = Thread.currentThread().getContextClassLoader();
| InputStream stream = loader
| .getResourceAsStream("rolesAllowed.properties");
|
here rolesAllowed.properties is a file resource located at $JBOSS_HOME/server/default/conf.
you can use any relative path that is present on the ejb classpath.
I hope this helps you.
Best
Gustavo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098780#4098780
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098780
More information about the jboss-user
mailing list