Interface CsvXPorter

All Known Implementing Classes:
CsvPrinter, FileXPorter, GitCsvXPorter

public interface CsvXPorter
The interface CsvXPorter contains the needed methods to import and export a CSV file for different locations.
Since:
2.5 (18.02.25)
Author:
oboehm
  • Field Details

    • log

      static final Logger log
  • Method Details

    • getURI

      URI getURI()
      Simple getter for the import and export URI.
      Returns:
      URI
      Since:
      3.0
    • withURI

      CsvXPorter withURI(URI csvURI)
      Returns a (new) CsvXPorter with new URI.
      Parameters:
      csvURI - URI of the returned CsvXPorter
      Returns:
      usually a new CsvXPorter
    • exportCSV

      void exportCSV(URI uri, String csvHeadLine, List<String> csvLines) throws IOException
      Interface for exporting CSV.
      Parameters:
      uri - URI wher the CSV should be exported to
      csvHeadLine - CSV header
      csvLines - CSV lines
      Throws:
      IOException - in case of I/O problems
    • exportCSV

      default void exportCSV(String csvHeadLine, List<String> csvLines) throws IOException
      Interface for exporting CSV.
      Parameters:
      csvHeadLine - CSV header
      csvLines - CSV lines
      Throws:
      IOException - in case of I/O problems
      Since:
      3.0
    • exportCSV

      default void exportCSV(List<String> csvLines) throws IOException
      Interface for exporting CSV.
      Parameters:
      csvLines - CSV lines including head line
      Throws:
      IOException - in case of I/O problems
      Since:
      3.0
    • importCSV

      default List<String> importCSV(URI uri) throws IOException
      Interface for importing a CSV. This method should be called in exportCSV(URI, String, List) to aggregate the count of the actual export with former exports.
      Parameters:
      uri - URI where the CSV should be imported from
      Returns:
      list of CSV lines (including head line)
      Throws:
      IOException - in case of I/O problems
    • importCSV

      default List<String> importCSV() throws IOException
      Interface for importing a CSV. This method should be called in exportCSV(URI, String, List) to aggregate the count of the actual export with former exports.
      Returns:
      list of CSV lines (including head line)
      Throws:
      IOException - in case of I/O problems
      Since:
      3.0