title: Apache Tika and document metadata
body: <p>I'm doing simple processing of variety of documents (ODS, MS office, pdf) using Apache Tika. I have to get at least :</p>
  
  <pre><code>word count, author, title, timestamps, language etc.
  </code></pre>
  
  <p>which is not so easy. My strategy is using Template method pattern for 6 types of document, where I find the type of document first, and based on that I process it individually.</p>
  
  <p>I know that apache tika should remove the need for this, but the document formats are quite different right ? </p>
  
  <p>For instance </p>
  
  <pre><code>InputStream input = this.getClass().getClassLoader().getResourceAsStream(doc);
  ContentHandler textHandler = new BodyContentHandler();
  Metadata metadata = new Metadata();
  Parser parser = new OfficeParser();
  parser.parse(input, textHandler, metadata, new ParseContext());
  input.close();
  
  for(String s : metadata.names()) {
      System.out.println("Metadata name : "  + s);
  }
  </code></pre>
  
  <p>I tried to do this for ODS, MS office, pdf documents, and the metadada differs a lot. There is MSOffice interface that lists metadata keys for MS documents and some <strong>Dublic Core</strong> metadata list. But how should one implement an application like this ?</p>
  
  <p>Could please anybody who has experience with it share his experience ? Thank you</p>