Class FlowFileInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

public class FlowFileInputStream extends WriterPipedInputStream
An InputStream providing a FlowFile for supplied content and attributes that is written in a separate thread.
  • Method Details

    • create

      public static FlowFileInputStream create(InputStream inputStream, Map<String,String> attributes, long fileSize, ExecutorService executorService) throws IOException
      Creates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes in a FlowFile V1, starting a separate thread for writing.
      Parameters:
      inputStream - the InputStream containing the content
      attributes - the Map of attributes to include
      fileSize - the size of the content
      executorService - the ExecutorService used to submit the writing thread
      Returns:
      the FlowFileInputStream
      Throws:
      IOException - if an I/O error occurs
    • create

      public static FlowFileInputStream create(org.apache.nifi.util.FlowFilePackager flowFilePackager, InputStream inputStream, Map<String,String> attributes, long fileSize, ExecutorService executorService) throws IOException
      Creates a FlowFileInputStream that packages the content in the provided InputStream with the supplied attributes using the supplied FlowFilePackager, starting a separate thread for writing.
      Parameters:
      flowFilePackager - the FlowFilePackager used to package the content and attributes
      inputStream - the InputStream containing the content
      attributes - the Map of attributes to include
      fileSize - the size of the content
      executorService - the ExecutorService used to submit the writing thread
      Returns:
      the FlowFileInputStream
      Throws:
      IOException - if an I/O error occurs
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class WriterPipedInputStream
      Throws:
      IOException