Not an answer to your question but:

is it possible to save the file temporarily? which is worse, re-requesting the file or temporary file, your choice!

danny

shef wrote:

I'm trying to read Excel files over http. We need to
get both the contents and any metadata, like title and
author. We're using the HSSF eventmodel to read data.
It looks like we should also use the HPSF eventmodel
to get metadata.


Trouble is, I'm not sure they're compatible. It looks
like the code for each requires fetching all the data
from an InputStream -- but with http, we get only one
pass through the InputStream, otherwise we'll have to
request the file a second time.

The sample code for HSSF looks like this:

POIFSFileSystem poifs = new POIFSFileSystem(in);
InputStream din =
poifs.createDocumentInputStream("Workbook");
HSSFRequest req = new HSSFRequest();
req.addListenerForAllRecords(new
ExcelEventHandler(text));
HSSFEventFactory factory = new HSSFEventFactory();
factory.processEvents(req, din);
The code for HPSF looks like this:


POIFSReader r = new POIFSReader();
r.registerListener(new MyPOIFSReaderListener(),
"\005SummaryInformation");
r.read(new FileInputStream(filename));
How do I get these two to share the same inputstream?




__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to