com.splunk
Class ResultsReaderCsv

java.lang.Object
  extended by com.splunk.ResultsReader
      extended by com.splunk.ResultsReaderCsv

public class ResultsReaderCsv
extends ResultsReader

The ResultsReaderCsv class represents a streaming CSV reader for Splunk search results. This class requires the opencsv-2.3.jar file in your build path.


Constructor Summary
ResultsReaderCsv(java.io.InputStream inputStream)
          Class constructor.
 
Method Summary
 void close()
          Closes the reader and returns resources.
 Event getNextEvent()
          Returns the next event in the event stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultsReaderCsv

public ResultsReaderCsv(java.io.InputStream inputStream)
                 throws java.io.IOException
Class constructor. Constructs a streaming CSV reader for the event stream. You should only attempt to parse an CSV stream with the CSV reader. Using a non-CSV stream yields unpredictable results.

Parameters:
inputStream - The stream to parse.
Throws:
java.lang.Exception - On exception.
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Closes the reader and returns resources.

Overrides:
close in class ResultsReader
Throws:
java.io.IOException - On IO exception.

getNextEvent

public Event getNextEvent()
                   throws java.io.IOException
Returns the next event in the event stream.

Specified by:
getNextEvent in class ResultsReader
Returns:
The map of key-value pairs for an event. The format of multi-item values is implementation-specific. We recommend using the methods from the Event class to interpret multi-item values.
Throws:
java.io.IOException - On IO exception.