On Mon, 27 Feb 2012, Lewis John Mcgibbney wrote:
After compiling I get
[javac] MimeUtil.java:165: incompatible types
[javac] found :
java.lang.Object&java.io.Serializable&java.lang.Comparable<? extends
java.lang.Object&java.io.Serializable&java.lang.Comparable<?>>
[javac] required: org.apache.tika.mime.MimeType
[javac] type = mt != null ? mt : type;
Tika.detect(URL) returns the mimetype as a String
The detectors themselves return a MediaType
Depending on what you want your code to do, the options are probably:
* Switch your code to use a mimetype String
* Switch your code to use MediaType rather than MimeType, and call
DefaultDetector directly (rather than using the Tika facade class)
* If you get back a String (not null) for the mimetype, create a MimeType
object for it
The right answer for you depends on the code you've got around the Tika
call
Nick