Class CsvServiceImpl

    • Field Detail

      • HEADERS

        public static final String[] HEADERS
      • HEADERS_STRING

        public static final String HEADERS_STRING
    • Constructor Detail

      • CsvServiceImpl

        public CsvServiceImpl​(RuleValidator ruleValidator)
    • Method Detail

      • parseCSV

        public CsvImportResult parseCSV​(Group group,
                                        InputStream inputStream,
                                        boolean hasHeader)
                                 throws CSVImportException
        Description copied from interface: CsvService
        Parses the given CSV stream into rules.
        Specified by:
        parseCSV in interface CsvService
        inputStream - The inputstream to read the CSV from.
        hasHeader - If defined, the csv defined by the inputStream has an header, and this is skipped (not considered as a Rule).
        Returns:
        The list of rules. Only returns, if ALL rules are valid, otherwise the CSVImportException is thrown.
        Throws:
        CSVImportException - is thrown when parsing the CSV fails.
      • createCSV

        public String createCSV​(List<Rule> rules)
        Description copied from interface: CsvService
        Creates a CSV string from the given rules.
        Specified by:
        createCSV in interface CsvService
        Returns:
        CSV string representation of given rules.