Interface DocumentSource
- All Known Implementing Classes:
AmazonS3Source, AzureBlobStorageSource, ClassPathSource, FileSystemSource, GcsSource, GitHubSource, TencentCosSource, UrlSource
public interface DocumentSource
Defines the interface for a Document source.
Documents can be loaded from various sources such as the file system, HTTP, FTP, etc.
-
Method Summary
Modifier and TypeMethodDescriptionProvides anInputStreamto read the content of the document.metadata()Returns the metadata associated with the source of the document.
-
Method Details
-
inputStream
Provides anInputStreamto read the content of the document. This method can be implemented to read from various sources like a local file or a network connection.- Returns:
- An InputStream from which the document content can be read.
- Throws:
IOException- If an I/O error occurs while creating the InputStream.
-
metadata
Metadata metadata()Returns the metadata associated with the source of the document. This could include details such as the source location, date of creation, owner, etc.- Returns:
- A
Metadataobject containing information about the document source, such asDocument.FILE_NAMEandDocument.ABSOLUTE_DIRECTORY_PATH.
-