I have java web app. I am using ANT
to build the application. I have a file in the resources folder. I want to open that file using a pdfViewer. The frame of the pdf viewer is getting launched. But I am not able to access the file present in the resources folder. here is my code.
final String fileName="Installation.pdf";
int pagenum = 0;
RandomAccessFile raf = new RandomAccessFile (new File(fileName), "r");
FileChannel fc = raf.getChannel ();
ByteBuffer buf = fc.map (FileChannel.MapMode.READ_ONLY, 0, fc.size ());
PDFFile pdfFile = new PDFFile (buf);
I am getting a
FileNotFoundException
. The main problem is that I am not able to locate the file in the resources folder. What Please help.
The above is working properly when I run it as a stand alone java application.