I am able to read and write file in a EJB by using
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.
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.
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.