tags:

views:

85

answers:

1

I am using the Apache Commons Uploader package, and I am trying to read a file that is being uploaded. I have a FileItem object.

The first few lines of the file are ASCII and I want to be able to read them and extract the metadata that is contained in them. What is the best method/pattern to go about doing this.

+1  A: 

Call getInputStream() on the FileItem, wrap that in a BufferedReader, then read your file line by line using BufferedReader.readLine() until you've read the meta data.

skaffman