Tomas
Tomas

Reputation: 1262

Create text file from EJB without java.io

A well known constraint is that you should not use java.io in EJB's to access the file system. I need to create a text file and send it via email when a particular method is invoked in my ejb application.

I need an architectural solution on how to do this without using java.io. The only approach I see is to create a separate web service for this job. Also there was a suggestion to use Apache camel, but I don't know how camel can help to achieve this.

Upvotes: 0

Views: 560

Answers (1)

Tomas
Tomas

Reputation: 1262

We found a way to avoid using the file system from ejb's by creating the files as ByteOutputStream in memory and sending them via email. This way we don't need to use the file system. Similar example: Create a Zip File in Memory

Upvotes: 2

Related Questions