Currently, I am developing a document sharing application where I need to display a file which could be ASCII or an image files residing on a file system. Is there any clean way to do so through an EJB?
Section 24.1.2 of the EJB 2.0 spec restricts enterprise beans from accessing files and directories. It does this by restricting access to the java.io package. While your application server will undoubtedly allow it, you should probably try and avoid it, if possible. Otherwise, you may one day hit a bug, log a support call, and get "Sorry - that is not supported" which could be a nightmare.
If you are using a clustered environment then you need to realise that you will introduce a single point of failure into your system as your files will no doubt be kept on the one file system and not clustered. If the file system goes down then so will your cluster.
Have you thought about using JDBC instead? You can store image files as BLOBs in the DB. You could also defer some of the logic to lookup a specific file to your presentation tier.
Just my .02.