On Jul 9, 2008, at 6:52 AM, greeklinux wrote:


Hello,

I do not know if it helps:

Can you read the CSV file as Resource, get the IResourceStream, then
getInputStream() on IResourceStream and put this inputStream in a
java.io.InputStreamReader?


Yeah, that's basically where I am. I thought maybe there was a way to simplify the process.

Here's what I've have...

IResourceStream resStream = new PackageResourceStream(WicketApplication.class, "protocols.csv");
InputStream inStream = resStream.getInputStream();
InputStreamReader isr = new InputStreamReader(inStream);
List<String[]> protocolList = new CSVReader(isr).readAll();
inStream.close();

I could collapse this a bit, but I need to keep hold of IResourceStream so that I can close it after the CSVReader.readAll() call.

-David

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

Reply via email to