• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Is this possible from an EAR?

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an EAR containing a WAR & several EJBs (running on Weblogic 9.2, not sure if that makes any difference though)

From either an EJB or WAR I need to be able to create and read external files. Is this possible?

So, if I created a file from the EJB (with no path) say "abc.txt", where will it be created and how would I read that from the WAR - and vice versa?

thanks in advance
 
Ranch Hand
Posts: 66
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
File IO in EJBs? Could you take a look at this for: Why can't EJBs read and write files and directories in the filesystem? And why can't they access file descriptors? and also this: http://stackoverflow.com/questions/1357667/how-to-access-the-file-system-from-an-ejb-3.

Let us know what you think.
 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
many thanks for that, working my way through it now - I can if I wish do all file I/O from the WAR, is that possible/safe?
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic