You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by Daniel Knapp <da...@mni.fh-giessen.de> on 2009/12/02 21:52:58 UTC
setting the content-type in metadata before parsing
Hello,
i want to set the content-type of a file before i parse it. I've seen on the Tika Website that this is possible and an advantage during the parsing process.
What is the right name and value of this attribute (expect for pdf = application/pdf ?)? Is the following method right?
metadata.set("attribute-name", "value");
Hope i'm clear.
Regards,
Daniel
Re: setting the content-type in metadata before parsing
Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hi Daniel,
I think you're looking for:
Metadata met = new Metadata();
met.set(Metadata.CONTENT_TYPE, "application/pdf");
HTH!
Cheers,
Chris
On 12/2/09 12:52 PM, "Daniel Knapp" <da...@mni.fh-giessen.de> wrote:
> Hello,
>
> i want to set the content-type of a file before i parse it. I've seen on the
> Tika Website that this is possible and an advantage during the parsing
> process.
> What is the right name and value of this attribute (expect for pdf =
> application/pdf ?)? Is the following method right?
>
> metadata.set("attribute-name", "value");
>
> Hope i'm clear.
>
> Regards,
> Daniel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW: http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department University of
Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++