tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <apa...@gagravarr.org>
Subject Re: Executing file inside Parser
Date Thu, 02 Aug 2012 21:42:50 GMT
On Thu, 2 Aug 2012, 122jxgcn wrote:
> I'm trying to execute binary file inside my custom parser.
> I put binary file on directory
>
> tika-parsers/src/main/resources/bin/hwp2xml.bin

Hmm, I'm not sure that'll work. The resources normally end up embedded in 
the Jar, and most OS's don't know how to execute binaries from the middle 
of a jar....

> and I'm doing something like on my parser
>
> if (!tstream.hasFile()) File f = tstream.getFile();
> Process ps = Runtime.getRuntime().exec("/bin/hwp2xml.bin", null, f);

I doubt that'll work. You should either put the binary outside of the jar, 
or have a precurser step that extracts the resource out of a jar and puts 
it into a temporary file that the OS can find to launch

Nick

Mime
View raw message