Class FileSystemEmitter

  • All Implemented Interfaces:
    Emitter, StreamEmitter

    public class FileSystemEmitter
    extends AbstractEmitter
    implements StreamEmitter
    Emitter to write to a file system.

    This calculates the path to write to based on the basePath and the value of the TikaCoreProperties.SOURCE_PATH value.

      <properties>
          <emitters>
              <emitter class="org.apache.tika.pipes.emitter.fs.FileSystemEmitter>
                  <params>
                      <!-- required -->
                      <param name="name" type="string">fs</param>
                      <!-- required -->
                      <param name="basePath" type="string">/path/to/output</param>
                      <!-- optional; default is 'json' -->
                      <param name="fileExtension" type="string">json</param>
                      <!-- optional; if the file already exists,
                           options ('skip', 'replace', 'exception')
                      default is 'exception' -->
                      <param name="onExists" type="string">skip</param>
                      <!-- optional; whether or not to pretty print the output
                          default is false -->
                         <param name="prettyPrint" type="boolean">true</param>
                  </params>
              </emitter>
          </emitters>
      </properties>