Interface CSVFileStore

  • All Superinterfaces:
    BasicFileStore
    All Known Implementing Classes:
    CSVFileStoreConnector

    public interface CSVFileStore
    extends BasicFileStore
    CSVFileStore defines the specific connector api for working with CSV files. A CSV file is one where each row represents a record that is divided into attributes that are separated by a special character (usually a space). Each row has the same list of attributes and so the file is effectively a table of data.
    • Method Detail

      • getRecordCount

        long getRecordCount()
                     throws FileException,
                            FileReadException
        Return the number of records in the file. This is achieved by scanning the file and counting the records - not recommended for very large files.
        Returns:
        count
        Throws:
        FileException - there is a problem accessing the file
        FileReadException - unable to find, open or scan the file.
      • getColumnNames

        List<String> getColumnNames()
                             throws FileException,
                                    FileReadException
        Return the list of column names associated with this structured file. This may be embedded in the first line of the file or encoded in the connection object used to create a connector instance.
        Returns:
        a list of column names
        Throws:
        FileException - there is a problem accessing the file
        FileReadException - unable to retrieve the column names
      • readRecord

        List<String> readRecord​(int rowNumber)
                         throws FileException,
                                FileReadException
        Return the requested data record. The first record is record 0. If the first line of the file is the column names then record 0 is the line following the column names.
        Parameters:
        rowNumber - long
        Returns:
        List of strings, each string is the value from the column.
        Throws:
        FileException - there is a problem accessing the file
        FileReadException - unable to find, open or read the file, or the file does not include the requested record.