Package org.springframework.ai.writer
Class FileDocumentWriter
java.lang.Object
org.springframework.ai.writer.FileDocumentWriter
- All Implemented Interfaces:
Consumer<List<Document>>
,DocumentWriter
Writes the content of a list of
Document
s into a file.- Author:
- Christian Tzolov
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFileDocumentWriter
(String fileName) FileDocumentWriter
(String fileName, boolean withDocumentMarkers) FileDocumentWriter
(String fileName, boolean withDocumentMarkers, MetadataMode metadataMode, boolean append) Writes the content of a list ofDocument
s into a file. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.document.DocumentWriter
write
-
Field Details
-
METADATA_START_PAGE_NUMBER
- See Also:
-
METADATA_END_PAGE_NUMBER
- See Also:
-
-
Constructor Details
-
FileDocumentWriter
-
FileDocumentWriter
-
FileDocumentWriter
public FileDocumentWriter(String fileName, boolean withDocumentMarkers, MetadataMode metadataMode, boolean append) Writes the content of a list ofDocument
s into a file.- Parameters:
fileName
- The name of the file to write the documents to.withDocumentMarkers
- Whether to include document markers in the output.metadataMode
- Document content formatter mode. Specifies what document content to be written to the file.append
- iftrue
, then data will be written to the end of the file rather than the beginning.
-
-
Method Details