It seems that it is forbidden to read files from an EJB as stated in this link:
http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html#file_access
Enterprise beans aren't allowed to access files primarily because files are not transactional resources. Allowing EJBs to access files or directories in the filesystem, or to use file descriptors, would compromise component distributability, and would be a security hazard.
What does "compromise component distributability" ???