Hi,
I have a requirement to embed an image in an excel file dynamically from a
Java class. The Java class is a part of the web module of an EAR file which is getting deployed in WAS 5.0.
To embed the image in the excel file at the runtime, I need to create a file object for the same. I can do that easily if I save the image somewhere on 'C' drive and provide its exact path to the File class constructor. But I do not want to do that.
Instead I want to bundle the image file in the EAR. I tried this by saving the image file under the same package where the above java class (from where I want to create file object) resides.
But the problem is that, the class is not able to recognize/locate the file and giving 'FileNotFoundException', when I try to embed it in the excel file.
Is there any way we can access the image file from the java class, while bundling it in the EAR file?
Thanks,
Shailesh.