Package org.javlo.utils
Class CSVFactory
- java.lang.Object
-
- org.javlo.utils.CSVFactory
-
public class CSVFactory extends Object
- Author:
- pvandermaesen
-
-
Constructor Summary
Constructors Constructor Description CSVFactory(File file)
constructorCSVFactory(File file, String sep)
constructorCSVFactory(InputStream csvStream)
constructorCSVFactory(InputStream csvStream, String sep)
constructorCSVFactory(InputStream csvStream, String sep, Charset charset)
CSVFactory(String[][] newArray)
CSVFactory(String separator, InputStream csvStream)
constructor
-
Method Summary
-
-
-
Constructor Detail
-
CSVFactory
public CSVFactory(String separator, InputStream csvStream) throws IOException
constructor- Parameters:
separator
- separator between col- Throws:
IOException
-
CSVFactory
public CSVFactory(InputStream csvStream) throws IOException
constructor- Parameters:
separator
- separator between col- Throws:
IOException
-
CSVFactory
public CSVFactory(File file) throws IOException
constructor- Parameters:
separator
- separator between col- Throws:
IOException
-
CSVFactory
public CSVFactory(File file, String sep) throws IOException
constructor- Parameters:
separator
- separator between col- Throws:
IOException
-
CSVFactory
public CSVFactory(InputStream csvStream, String sep) throws IOException
constructor- Parameters:
separator
- separator between col- Throws:
IOException
-
CSVFactory
public CSVFactory(InputStream csvStream, String sep, Charset charset) throws IOException
- Throws:
IOException
-
CSVFactory
public CSVFactory(String[][] newArray)
-
-
Method Detail
-
getArray
public String[][] getArray()
-
exportCSV
public void exportCSV(OutputStream outStream)
-
exportCSV
public void exportCSV(OutputStream outStream, String separator)
-
exportRowCSV
public void exportRowCSV(OutputStream outStream, String[] row)
-
exportRowCSV
public void exportRowCSV(OutputStream outStream, Collection<String> row)
-
exportRowCSV
public static void exportRowCSV(OutputStream outStream, String separator, String[] row)
-
appendRow
public void appendRow(String[] row)
-
exportLine
public static final String exportLine(Collection<String> data, String separator)
-
exportRowCSV
public void exportRowCSV(OutputStream outStream, String separator, Collection<String> row)
-
searchCSVSep
public static String searchCSVSep(String csvContent) throws IOException
- Throws:
IOException
-
searchCSVSep
public static String searchCSVSep(File csvFile) throws IOException
- Throws:
IOException
-
readHeads
public String[] readHeads(File file) throws IOException
- Throws:
IOException
-
readHeads
public String[] readHeads(InputStream in) throws IOException
- Throws:
IOException
-
loadContentAsMap
public static List<Map<String,String>> loadContentAsMap(File file) throws IOException
- Throws:
IOException
-
loadContentAsCell
public static Cell[][] loadContentAsCell(File file) throws IOException
- Throws:
IOException
-
loadContentAsCell
public static Cell[][] loadContentAsCell(InputStream in) throws IOException
- Throws:
IOException
-
loadTitle
public static List<String> loadTitle(File file) throws IOException
- Throws:
IOException
-
loadTitle
public static List<String> loadTitle(InputStream in) throws IOException
- Throws:
IOException
-
loadContentAsMap
public static List<Map<String,String>> loadContentAsMap(InputStream in) throws IOException
- Throws:
IOException
-
storeContentAsMap
public static void storeContentAsMap(File file, List<Map<String,String>> content, boolean sort) throws IOException
- Throws:
IOException
-
appendContentAsMap
public static void appendContentAsMap(File file, Map<String,String> content, boolean sort) throws IOException
- Throws:
IOException
-
merge
public CSVFactory merge(CSVFactory externalFile)
-
size
public int size()
-
main
public static void main(String[] args)
-
-