Class CSVFileStoreConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
org.odpi.openmetadata.adapters.connectors.datastore.csvfile.CSVFileStoreConnector
- All Implemented Interfaces:
BasicFileStore,CSVFileStore,SecureConnectorExtension,VirtualConnectorExtension
CSVFileStoreConnector works with structured files to retrieve simple tables of data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
fileStoreNameFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the fileReturn the list of column names associated with this structured file.charReturn the defined delimiter character.charReturn the defined quote char.longReturn the number of records in the file.Return any fixed column names defined by the connectorreadRecord(long dataRecordNumber) Return the requested data record.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
getCreationDate, getFile, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate, setFileStoreNameMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestampMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate
-
Constructor Details
-
CSVFileStoreConnector
public CSVFileStoreConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classBasicFileStoreConnector- Throws:
ConnectorCheckedException- there is a problem within the connector.UserNotAuthorizedException- the connector was disconnected before/during start
-
getSuppliedColumnNames
Return any fixed column names defined by the connector- Returns:
- list of configured column names
-
getDelimiterChar
public char getDelimiterChar()Return the defined delimiter character.- Returns:
- char
-
getQuoteChar
public char getQuoteChar()Return the defined quote char.- Returns:
- char
-
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.- Specified by:
getRecordCountin interfaceCSVFileStore- Returns:
- count
- Throws:
FileException- 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.- Specified by:
getColumnNamesin interfaceCSVFileStore- Returns:
- a list of column names
- Throws:
FileException- 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.- Specified by:
readRecordin interfaceCSVFileStore- Parameters:
dataRecordNumber- long- Returns:
- List of strings, each string is the value from the column.
- Throws:
FileException- problem accessing the fileFileReadException- unable to find, open or read the file, or the file does not include the requested record.
-
disconnect
public void disconnect()Close the file- Overrides:
disconnectin classBasicFileStoreConnector
-