Hi,

On 9/25/07, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:
> On 9/25/07, kbennett <[EMAIL PROTECTED]> wrote:
> > ...We could also make one default configuration per thread using
> > threadlocal to avoid the overhead of synchronization, but I've heard that
> > synchronization is not as slow as it used to be, so that might be 
> > overkill....
>
> Yes, compared to what happens next (parsing of possibly large files),
> one synchronized block won't matter much!

On the other hand, compared to that I'd just as well just recreate the
full config instance. Using a static variable, synchronization, etc.
sounds too complex to me.

How about something like this:

    public static TikaConfig getDefaultConfig()
            throws IOException, JDOMException {
        return new TikaConfig(
                TikaConfig.class.getResourceAsStream("tika-config.xml"));
    }

BR,

Jukka Zitting

Reply via email to