|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.ui.aribaweb.util.CSVReader
public final class CSVReader
CSVReader parses files in CSV (comma separated values) format. Subclassers should implement the consumeLineOfTokens method.
| Constructor Summary | |
|---|---|
CSVReader(CSVConsumer csvConsumer)
Create a new CSVReader using a specific CSVConsumer to handle the rows. |
|
| Method Summary | |
|---|---|
String |
getEncoding()
Return the encoding used for the last read operation. |
boolean |
isEncodingExplicitlySet()
Returns true if the file had the encoding as the first line in the file, e.g. |
void |
read(File file,
String encoding)
Reads the specified file, using the character encoding for the default locale. |
void |
read(Reader reader,
String location)
The primitive read entry point. |
void |
read(URL url,
String defaultEncoding)
Reads the specified URL, using the character encoding for the default locale. |
void |
readForSpecifiedEncoding(File file)
Will read from the specified stream in the encoding specified on the first line of the stream. |
void |
readForSpecifiedEncoding(InputStream inputStream,
String location)
Will read from the specified stream in the encoding specified on the first line of the stream. |
void |
readForSpecifiedEncoding(URL url)
Will read from the specified stream in the encoding specified on the first line of the stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVReader(CSVConsumer csvConsumer)
| Method Detail |
|---|
public String getEncoding()
public boolean isEncodingExplicitlySet()
public void read(URL url,
String defaultEncoding)
throws IOException
url - the URL to read the data fromdefaultEncoding - the encoding to use to read the data if
none can be determined from the URLConnection
IOException - any IOException reading from the URL
public void read(File file,
String encoding)
throws IOException
file - a path to the file to readencoding - The encoding used for reading the file
IOException - any IOException reading from the file
could not be read.
public void readForSpecifiedEncoding(URL url)
throws IOException
url - the URL to read the data from
IOException - any IOException reading from the URL
public final void readForSpecifiedEncoding(File file)
throws IOException
file - the path to the file to read
IOException - if an IOException occurs while reading
the fileread(Reader, String)
public final void readForSpecifiedEncoding(InputStream inputStream,
String location)
throws IOException
inputStream - the InputStream to read the data fromlocation - the path to the data source for debugging messages
IOException - if an IOException occurs while reading
the fileread(Reader, String)
public final void read(Reader reader,
String location)
throws IOException
reader - the data source as passed in by one of the
higher level read methodslocation - the path for debugging messages
IOException - if an IOException occurs while reading
from readerCSVConsumer.consumeLineOfTokens(java.lang.String, int, java.util.List)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||