Package org.openmetadata.csv
Class CsvUtil
- java.lang.Object
-
- org.openmetadata.csv.CsvUtil
-
public final class CsvUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringFIELD_SEPARATORstatic StringLINE_SEPARATORstatic StringSEPARATOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>addEntityReference(List<String> csvRecord, EntityReference ref)static List<String>addEntityReferences(List<String> csvRecord, List<EntityReference> refs)static List<String>addField(List<String> csvRecord, Boolean field)static List<String>addField(List<String> csvRecord, String field)static List<String>addFieldList(List<String> csvRecord, List<String> field)static List<String>addOwner(List<String> csvRecord, EntityReference owner)static List<String>addTagLabels(List<String> csvRecord, List<TagLabel> tags)static List<String>addUserOwner(List<String> csvRecord, EntityReference owner)static List<String>fieldToStrings(String field)static StringformatCsv(CsvFile csvFile)static List<String>getHeaders(List<CsvHeader> csvHeaders)Get headers from CsvHeadersstatic Stringquote(String field)static StringquoteField(List<String> field)Quote a CSV field made of multiple strings that has SEPARATOR or FIELD_SEPARATOR with " "static StringrecordToString(String[] fields)static StringrecordToString(List<String> fields)static StringrecordToString(org.apache.commons.csv.CSVRecord csvRecord)
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
FIELD_SEPARATOR
public static final String FIELD_SEPARATOR
- See Also:
- Constant Field Values
-
LINE_SEPARATOR
public static final String LINE_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
formatCsv
public static String formatCsv(CsvFile csvFile) throws IOException
- Throws:
IOException
-
getHeaders
public static List<String> getHeaders(List<CsvHeader> csvHeaders)
Get headers from CsvHeaders
-
recordToString
public static String recordToString(org.apache.commons.csv.CSVRecord csvRecord)
-
quoteField
public static String quoteField(List<String> field)
Quote a CSV field made of multiple strings that has SEPARATOR or FIELD_SEPARATOR with " "
-
addEntityReferences
public static List<String> addEntityReferences(List<String> csvRecord, List<EntityReference> refs)
-
addEntityReference
public static List<String> addEntityReference(List<String> csvRecord, EntityReference ref)
-
addOwner
public static List<String> addOwner(List<String> csvRecord, EntityReference owner)
-
addUserOwner
public static List<String> addUserOwner(List<String> csvRecord, EntityReference owner)
-
-