| 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.
|
 |
 |
|
|
subject: How can I process a resource file in ejb?
|
|
|