On Sun, 26 Feb 2012, Lewis John Mcgibbney wrote:
// If no mime-type header, or cannot find a corresponding registered
// mime-type, then guess a mime-type from the url pattern
type = this.mimeTypes.getMimeType(url) != null ? this.mimeTypes
.getMimeType(url) : type;
}
Looking @ Tika 0.10 Javadoc I see that in particular it's the call to
.getMimeType(url) which has been deprecated and we should be using
Tika.detect(URL) instead.
How about:
String mt = Tika.detect(URL);
type = mt != null ? mt : type;
That uses the new style call, and avoids detecting twice which your old
code did
Nick