[Bug 309778] Re: KDE always associates *.jar with the zip mime type

David Faure faure at kde.org
Thu Sep 17 13:46:56 UTC 2009


Reported in KDE as https://bugs.kde.org/show_bug.cgi?id=207517, but this is indeed a debian/ubuntu bug. There's no reason for /usr/share/mime/packages/sun-java6-jre.xml to exist, it only redefines what freedesktop.org.xml already defines, and with another mimetype name.
That file should be removed from the package.

The reason the accuracy is low is that there's a conflict on the *.jar
glob, when both application/java-archive (from packages/sun-
java5-jre.xml) and application/x-java-archive (from freedesktop.org.xml)
are associated with it. So kmimetypefinder doesn't really know which one
to choose. To help deciding that it does mimetype sniffing (looking at
the contents), and that says application/zip - because the magic for jar
files seems wrong/incomplete.

freedesktop.org.xml says
    <magic priority="85">
      <match value="PK\003\004" type="string" offset="0">
        <match value="0xcafe" type="host16" offset="40"/>
      </match>
    </magic>
but although I see PK\003\004 in all jar files (the zip header), I don't see 0xcafe at offset 40. Does someone know of a proper way to recognize a jar file from its contents?

Anyway all this seems to come from the missing application/java-archive
alias for application/x-java-archive in freedesktop.org.xml (it should
have been defined as an alias, not as a conflicting glob, in the xml
file...). That mimetype name has NOT been registered to IANA, so in
theory it should have a x- prefix, but well, it seems commonly used that
way so I think I can add it to shared-mime-info.

** Bug watch added: KDE Bug Tracking System #207517
   http://bugs.kde.org/show_bug.cgi?id=207517

-- 
KDE always associates *.jar with the zip mime type
https://bugs.launchpad.net/bugs/309778
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list