Class BasicFileStoreConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
- All Implemented Interfaces:
BasicFileStore,SecureConnectorExtension,VirtualConnectorExtension
- Direct Known Subclasses:
CSVFileStoreConnector
BasicFileStoreConnector works with files to retrieve simple information about the file and provides
access to the file object.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
FieldsFields 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 creation date for the file.getFile()Return the Java File object that provides access to the file.protected FileReturn the Java File object that provides access to the file.longReturn the number of bytes in the fileReturn the name of the file to read.Return the last accessed date for the file.Return the last update date for the file.voidsetFileStoreName(String fileStoreName) Set up the name of the file store.voidstart()Indicates that the connector is completely configured and can begin processing.Methods 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, setStatisticTimestamp
-
Field Details
-
fileStoreName
-
-
Constructor Details
-
BasicFileStoreConnector
public BasicFileStoreConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.UserNotAuthorizedException- the connector was disconnected before/during start
-
setFileStoreName
Set up the name of the file store. This may override the value supplied in the endpoint. An exception is thrown if the file name is not valid.- Parameters:
fileStoreName- path name of the desired file- Throws:
FileException- this is not a file that can be used
-
getFileName
Return the name of the file to read.- Specified by:
getFileNamein interfaceBasicFileStore- Returns:
- file name
- Throws:
FileException- problem accessing the file
-
getFileLength
Return the number of bytes in the file- Specified by:
getFileLengthin interfaceBasicFileStore- Returns:
- number
- Throws:
FileException- unable to locate the file
-
getCreationDate
Return the creation date for the file.- Specified by:
getCreationDatein interfaceBasicFileStore- Returns:
- Date object
- Throws:
FileException- problem accessing the fileFileReadException- - the file name is null, the file does not exist, or is a directory or is not readable.
-
getLastUpdateDate
Return the last update date for the file.- Specified by:
getLastUpdateDatein interfaceBasicFileStore- Returns:
- Date object
- Throws:
FileReadException- problem accessing the fileFileReadException- problem accessing the fileFileException- there is a problem accessing the file
-
getLastAccessDate
Return the last accessed date for the file.- Specified by:
getLastAccessDatein interfaceBasicFileStore- Returns:
- Date object
- Throws:
FileException- problem accessing the fileFileReadException- - the file name is null, the file does not exist, or is a directory or is not readable.
-
getFile
Return the Java File object that provides access to the file.- Specified by:
getFilein interfaceBasicFileStore- Returns:
- File object
- Throws:
FileException- problem accessing the file
-
getFile
Return the Java File object that provides access to the file.- Parameters:
methodName- , calling method- Returns:
- File object
- Throws:
FileException- problem accessing the file
-
disconnect
public void disconnect()Close the file- Overrides:
disconnectin classConnectorBase
-