Interface CSVFileStore
- All Superinterfaces:
BasicFileStore
- All Known Implementing Classes:
CSVFileStoreConnector
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 Summary
Modifier and TypeMethodDescriptionReturn the list of column names associated with this structured file.long
Return the number of records in the file.readRecord
(long rowNumber) Return the requested data record.Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate
-
Method Details
-
getRecordCount
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 fileFileReadException
- unable to find, open or scan the file.
-
getColumnNames
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 fileFileReadException
- unable to retrieve the column names
-
readRecord
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 fileFileReadException
- unable to find, open or read the file, or the file does not include the requested record.
-