Class ExportFileWriteContext

java.lang.Object
com.broadleafcommerce.common.dataexport.service.ExportFileWriteContext
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
CSVExportFileWriteContext

public abstract class ExportFileWriteContext extends Object implements AutoCloseable
Holds state information particular to a specific export write operation. The usage pattern is that the ExportManager will create an instance of this context (through ExportFileWriter.createExecutionContext(OutputStream)), which is bound to the output stream of the target file. It will then supply this context to the file writer in subsequent operations, and the file writer will use/update the state information within the context to write the data.

When the ExportManager determines that the writing should be ended (either on success or error), it will call AutoCloseable.close(). It is a requirement that the invocation of this method will close the outputStream and any other resources that were opened.

Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • ExportFileWriteContext

      public ExportFileWriteContext(@NonNull @NonNull OutputStream outputStream)
  • Method Details

    • getOutputStream

      @NonNull public @NonNull OutputStream getOutputStream()