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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>getColumnNames()Return the list of column names associated with this structured file.StringgetFileName()Return the name of the file to read.DategetLastUpdateDate()Return the last update data for the file.longgetRecordCount()Return the number of records in the file.List<String>readRecord(int rowNumber)Return the requested data record.-
Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getFile
-
-
-
-
Method Detail
-
getFileName
String getFileName() throws FileException, FileReadException
Return the name of the file to read.- Returns:
- file name
- Throws:
FileException- there is a problem accessing the fileFileReadException- - the file name is null, the file does not exist, or is a directory or is not readable.
-
getLastUpdateDate
Date getLastUpdateDate() throws FileException, FileReadException
Return the last update data for the file.- Returns:
- Date object
- Throws:
FileException- there is a problem accessing the fileFileReadException- - the file name is null, the file does not exist, or is a directory or is not readable.
-
getRecordCount
long getRecordCount() throws FileException, FileReadExceptionReturn 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
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 fileFileReadException- 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 fileFileReadException- unable to find, open or read the file, or the file does not include the requested record.
-
-