On Feb 1, 2008 3:34 PM, Jukka Zitting <[EMAIL PROTECTED]> wrote:
>
> On Feb 1, 2008 4:22 PM, Litrik De Roy <[EMAIL PROTECTED]> wrote:
> > I started working on the Eclipse plug-in that I have mentioned earlier
> > but I ran into a problem with the AutoDetectParser.
> >
> > [...]
> > I there anything special that must be done to get POI to work?
>
> We currently don't have any magic header matchers for Microsoft Office
> file formats, so the only thing AutoDetectParser can use to detect the
> file type is the file name suffix.
>
> Do you have the file name available to your plugin? You can feed the
> file name to AutoDetectParser like this:
>
>     AutoDetectParser parser = new AutoDetectParser();
>     InputStream stream = ...;
>     ContentHandler handler = ...;
>     Metadata metadata = new Metadata();
>     metadata.set(Metadata.RESOURCE_NAME_KEY, ...);
>     parser.parse(stream, handler, metadata);
>

That does the trick. Thanks.

-- 
Litrik De Roy
Norio ICT Consulting - http://www.norio.be/
[EMAIL PROTECTED] - 0475 873235

Reply via email to