Class FSOutputStreamFactory

java.lang.Object
org.apache.tika.batch.fs.FSOutputStreamFactory
All Implemented Interfaces:
OutputStreamFactory

public class FSOutputStreamFactory extends Object implements OutputStreamFactory
  • Constructor Details

  • Method Details

    • getOutputStream

      public OutputStream getOutputStream(Metadata metadata) throws IOException
      This tries to create a file based on the FSUtil.HANDLE_EXISTING value that was passed in during initialization.

      If handleExisting is set to "SKIP" and the output file already exists, this will return null.

      If an output file can be found, this will try to mkdirs for that output file. If mkdirs() fails, this will throw an IOException.

      Finally, this will open an output stream for the appropriate output file.

      Specified by:
      getOutputStream in interface OutputStreamFactory
      Parameters:
      metadata - must have a value set for FSMetadataProperties.FS_ABSOLUTE_PATH or else NullPointerException will be thrown!
      Returns:
      OutputStream
      Throws:
      IOException