[ 
https://issues.apache.org/jira/browse/TIKA-573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972070#action_12972070
 ] 

Jukka Zitting commented on TIKA-573:
------------------------------------

It would be good if we could keep all media type information centralized in 
tika-mimetypes.xml, possibly with utility scripts that automatically map other 
type databases like mailcap files and the magic files mentioned in TIKA-86 into 
the XML format.

I'd also like to see us merge the extension and glob pattern information 
together. It looks like all the extensions in the mailcap file could be mapped 
to <glob> patterns in tika-mimetypes.xml, and conversely all <glob> patterns 
that start with "*." and contain no other wildcard characters could be mapped 
to file extensions to be returned by the proposed new method.

BTW, note that some media types are associated with more than one file 
extension. However, in all use cases I can think of the getExtension() method 
should return just a single "default" extension, which could simply be the 
extension that's listed first in the type database.

> MimeType.getExtension() and mailcap's mime.types
> ------------------------------------------------
>
>                 Key: TIKA-573
>                 URL: https://issues.apache.org/jira/browse/TIKA-573
>             Project: Tika
>          Issue Type: Improvement
>          Components: mime
>            Reporter: Maxim Valyanskiy
>         Attachments: TIKA-573.patch
>
>
> This patch adds getExtension() method to MimeType and support for reading 
> mime-types from mime.types format.
> I added mime.types file from Fedora Linux, license says that it is public 
> domain file:
> ===
> Red Hat disclaims any copyright on the "mailcap" and "mime-types" files and 
> places them in the public domain. You are 
> free to do whatever you wish with these files.
> The mailcap.4 man page is under an MIT license:
> Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
> Permission to use, copy, modify, and distribute this material
> for any purpose and without fee is hereby granted, provided
> that the above copyright notice and this permission notice
> appear in all copies, and that the name of Bellcore not be
> used in advertising or publicity pertaining to this
> material without the specific, prior written permission
> of an authorized representative of Bellcore.  BELLCORE
> MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
> OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
> WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
> Tom Callaway, Fedora Legal, Red Hat
> Thu Sep 17, 2009
> ===
> (we do not need man page, only mime.types file)
> getExtension() method can be used for creating friendly filename for 
> OLE-embedded files, streams and other cases when name is not known

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to