• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How can I process a resource file in ejb?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Dave.
Thanks.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic