-
1. Re: Writing a file in a EJB
regulus Mar 19, 2002 6:04 AM (in response to dnloreto)I am able to read and write file in a EJB by using
javax.activation.FileDataSource.
Something like this:
FileDataSource ds = new FileDataSource("/tmp/abc");
InputStream is = ds.getInputStream();
OutputStream os = ds.getOutputStream();
The EJB spec discourages the use of file io, so I'm not sure if this is legal or it's a hole in JBoss, and will be made illegal in future JBoss versions... I'm using JBoss 2.4.4. Can somebody from JBoss team help clarifying this? Thanks in advance. -
2. Re: Writing a file in a EJB
corban May 14, 2002 6:26 AM (in response to dnloreto)Hi,
afaik the ejb spec does permit direct file access via the java.io package, you would "leave" the container through an input/output stream. but javax.activation.FileDataSource is a resource provided by the container, i think you can use it as you can use a DataSource for example. -
3. Re: Writing a file in a EJB
dddu88 Nov 29, 2002 3:52 PM (in response to dnloreto)Hi, can we use FileDataSource in activation package for extensive file IO to local drive instead of using entity bean to put into database? because our requirements requires that.
Thanks