File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes How can I process a resource file in ejb? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "How can I process a resource file in ejb?" Watch "How can I process a resource file in ejb?" New topic
Author

How can I process a resource file in ejb?

zq Leng
Greenhorn

Joined: Oct 18, 2002
Posts: 3
Hi,
I have a binary file(Not java class file) want to be combined with a ejb jar(or ejb ear). This file will be used when my ejb is running and the file must be a seperate file(that means when running, this file can must be a standard disk file). Every time, when I generate a ejb(jar/ear) at the client side, we need to regenerate the binary file and want to deploy the binary file together with the ejb jar/ear to the server.
My question is how can I combine the binary file with ejb jar/ear? Just insert it into the jar/ear? And how can I extract the binary for the jar/ear after the deployment? Are there any ways that I can regard this file as a resource or made weblic can deploy the binary file automatically to server together with the ejb?
Thanks
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
If you simply put the binary file in the ejb jar, then the ejb code can read it using
this.getClass().getResourceAsStream( "/dir/filename" )
zq Leng
Greenhorn

Joined: Oct 18, 2002
Posts: 3
Thank you Dave.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I process a resource file in ejb?