Hello,
I'm trying to use Apache POI to parse a XLS file with
java.
When the file is in local I can do:
1 File file = new File("c:\\afile.xls");
2 InputStream is = file.toURL().openStream();
3 POIFSFileSystem fs = new POIFSFileSystem(is);
4 HSSFWorkbook wb = new HSSFWorkbook(fs);
without any problems.
It is working very well.
But when the file is on the web, I ave an instance of an HttpURLConnection to access it.
When I try the folloing:
1 InputStream is = httpURLCon.getUrl().openStream();
2 POIFSFileSystem fs = new POIFSFileSystem(is);
3 HSSFWorkbook wb = new HSSFWorkbook(fs);
I get a FileNotFoundException in line 3.
Does anyone knows a way to avoid this problem?
Thanks