Class CsvFile
java.lang.Object
net.sf.jailer.util.CsvFile
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA line in a CSV-file.static interfaceFilter for CSV lines. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.CsvFile(File csvFile, String block, CsvFile.LineFilter filter) Constructor.CsvFile(File csvFile, CsvFile.LineFilter filter) Constructor.CsvFile(InputStream in, String block, String location, CsvFile.LineFilter filter) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if a certain line can be found in this file.static String[]decodeLine(String line) Decodes and splits a CSV line.static StringencodeCell(String cell) Encodes a CSV cell.getLines()Gets the list of lines.Gets the list of lines of a cached block.
-
Field Details
-
BLOCK_INDICATOR
Indicates start of block inside a CSV file. -
ALL_BLOCKS
Special block-name for reading default block and cache all others.- See Also:
-
-
Constructor Details
-
CsvFile
Constructor.- Parameters:
csvFile- the csv file- Throws:
IOException
-
CsvFile
Constructor.- Parameters:
csvFile- the csv filefilter- optional line filter, ornullto accept all lines- Throws:
IOException
-
CsvFile
Constructor.- Parameters:
csvFile- the csv fileblock- the block to read,nullto read default block- Throws:
IOException
-
CsvFile
Constructor.- Parameters:
csvFile- the csv fileblock- the block to read,nullto read default blockfilter- optional line filter, ornullto accept all lines- Throws:
IOException
-
CsvFile
public CsvFile(InputStream in, String block, String location, CsvFile.LineFilter filter) throws IOException Constructor.- Parameters:
in- the input stream to read fromblock- the block to read,nullto read default blocklocation- a description of the input source used in error messagesfilter- optional line filter, ornullto accept all lines- Throws:
IOException
-
-
Method Details
-
decodeLine
-
encodeCell
-
getLines
Gets the list of lines.- Returns:
- list of lists of cell-contents
-
getLines
Gets the list of lines of a cached block.- Parameters:
block- the block name, ornullfor the default block- Returns:
- list of lines of the given block
- See Also:
-
contains
Checks if a certain line can be found in this file.- Parameters:
line- the line- Returns:
trueiff this file contains the line
-