MIME Types
Alan Bateman
Alan.Bateman at Sun.COM
Sun Jul 13 09:11:26 PDT 2008
Mark Thornton wrote:
> The Files.probeContentType documentation includes this sentence: "The
> string is guaranteed to be parsable according to the grammar in the
> RFC". However, one of the values I get is "image/OLYMPUS Raw Format"
> --- the RFC doesn't allow spaces in the sub type. Of course this also
> neither an IANA registered type nor does it start with x-. My registry
> entry for orf is "image/OLYMPUS Raw Format", so it is difficult to
> return anything else, but it does mean the guarantee can't be maintained.
I was on vacation so apologies for the late reply. Yes, this is a bug
and thanks for finding it. FileTypeDetector implementations are required
to return a content type with a syntax that adheres to that specified in
the RFC. So in the case of your ORF files, it should return "null"
(meaning that the file type is not recognized) as the registry contains
garbage. I'll fix this for the next build (Rajendra - thanks for
checking the GNOME based FileTypeDetector - it has the same bug).
>
> Another illegal MIME type
> "app/gg" app isn't a legal type (example: Documents\My Google
> Gadgets\Analog Clock-Google.gg)
The syntax is okay in this case so it okay for a FileTypeDetector to
return it.
-Alan.
More information about the nio-discuss
mailing list