Class FileDocumentWriter

java.lang.Object
org.springframework.ai.writer.FileDocumentWriter
All Implemented Interfaces:
Consumer<List<Document>>, DocumentWriter

public class FileDocumentWriter extends Object implements DocumentWriter
Writes the content of a list of Documents into a file.
Author:
Christian Tzolov
  • Field Details

  • Constructor Details

    • FileDocumentWriter

      public FileDocumentWriter(String fileName)
    • FileDocumentWriter

      public FileDocumentWriter(String fileName, boolean withDocumentMarkers)
    • FileDocumentWriter

      public FileDocumentWriter(String fileName, boolean withDocumentMarkers, MetadataMode metadataMode, boolean append)
      Writes the content of a list of Documents 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 - if true, then data will be written to the end of the file rather than the beginning.
  • Method Details