Package de.brifle.sdk.helper.operators
Class CsvOperator<Type extends CsvReceiverRecordType>
java.lang.Object
de.brifle.sdk.helper.operators.CsvOperator<Type>
-
Constructor Summary
ConstructorsConstructorDescriptionCsvOperator(Class<Type> recordType) CsvOperator(Class<Type> recordType, String macKey) -
Method Summary
Modifier and TypeMethodDescriptiongets the macKeyreadCsvFile(String path) read records from csv file.readCsvString(String csvString) read records from csv string.writeCsvFile(String path, List<Type> records) write records to csv filewriteCsvString(List<Type> records) write records to csv string
-
Constructor Details
-
CsvOperator
-
CsvOperator
-
-
Method Details
-
getMacKey
gets the macKey- Returns:
- the macKey
-
writeCsvFile
write records to csv file- Parameters:
path- path to the filerecords-- Returns:
-
writeCsvString
write records to csv string- Parameters:
records- records to write- Returns:
- csv string
-
readCsvFile
public List<Type> readCsvFile(String path) throws HMacValidationFailedException, HMacHeaderMissingException, IOException read records from csv file. If a macKey is provided, the HMAC will be validated and the records will be checked for tampering.- Parameters:
path- path to the file- Returns:
- list of records
- Throws:
HMacValidationFailedExceptionHMacHeaderMissingExceptionIOException
-
readCsvString
public List<Type> readCsvString(String csvString) throws HMacValidationFailedException, HMacHeaderMissingException, IOException read records from csv string. If a macKey is provided, the HMAC will be validated and the records will be checked for tampering.- Parameters:
csvString-- Returns:
- Throws:
HMacValidationFailedExceptionHMacHeaderMissingExceptionIOException
-