Interface CsvService

  • All Known Implementing Classes:
    CsvServiceImpl

    public interface CsvService
    Reads and creates Classification Rules defined as CSV.
    • Method Detail

      • parseCSV

        CsvImportResult parseCSV​(Group group,
                                 java.io.InputStream inputStream,
                                 boolean hasHeader)
                          throws CSVImportException
        Parses the given CSV stream into rules.
        Parameters:
        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

        java.lang.String createCSV​(java.util.List<Rule> rules)
        Creates a CSV string from the given rules.
        Parameters:
        rules -
        Returns:
        CSV string representation of given rules.