title: Apache Tika and File access instead of Java Input Stream
body: <p>I want to be able to create a new Tika parser to extract metadata from a file.  We're already using Tika and the metadata extraction will be done consistently.</p>
  
  <p>I think that I've run into this problem/enhancement request for Tika:</p>
  
  <p><a href="https://issues.apache.org/jira/browse/TIKA-153" rel="noreferrer">Allow passing of files or memory buffers to parsers</a></p>
  
  <p>I have a console c++ executable that accepts the path to a file on input and then outputs the metadata that it finds, each line consisting of name/value pairs.<br>
  The c++ code relies on libraries that expect a file path when accessing the data.
  It's not going to be possible to rewrite this executable in Java.
  I thought that it would be fairly easy to plug this into Tika.  But the Tika parser needs to be in Java and the Tika parser method that needs to be overridden takes an open input stream:</p>
  
  <p>void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) </p>
  
  <p>So I guess that my only solution will be to take the input stream and write it to a temporary file and then to process the file that gets written and to then finally clean up the file.  I hate messing with a temporary file and then potentially having to worry about cleanup of temp files should something go wrong and it doesn't get deleted.</p>
  
  <p>Does anyone have a clever idea about how to cleanly deal with something like this?</p>