[dna-issues] [JBoss JIRA] Commented: (DNA-497) Extension-based Mimetype Detector Should Be Moved To Common Project
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Tue Aug 4 11:02:29 EDT 2009
[ https://jira.jboss.org/jira/browse/DNA-497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12478861#action_12478861 ]
Randall Hauch commented on DNA-497:
-----------------------------------
Moved the functionality of the extension-based MIME type detector into dna-common, as a new MimeTypeUtil class. The ExtensionBasedMimeTypeDetector was changed to reuse (by subclassing) the functionality, but this allows other components that need the filename-based MIME type functionality to rely upon dna-common. Test cases and resource files were also moved (tho the ExtensionBasedMimeTypeDetectorTest class remains).
A few changes were made to the MimeTypeUtil class to make it a little more usable. First, the "load(...)" method was made public so that it could be used by other components to load their own files containing custom mappings. The resulting Map may be combined with multiple Map instances, and passed into one of the MimeTypeUtil constructors, optionally loading the default mappings.
Second, a new "mimeTypeOf(File)" method was added, and this simply grabs the name of the file and delegates to the "mimeTypeOf(String)" method.
> Extension-based Mimetype Detector Should Be Moved To Common Project
> -------------------------------------------------------------------
>
> Key: DNA-497
> URL: https://jira.jboss.org/jira/browse/DNA-497
> Project: DNA
> Issue Type: Task
> Components: Common, Graph
> Affects Versions: 0.6
> Reporter: Dan Florian
> Assignee: Randall Hauch
>
> This class performs a generic utility and should be moved to common.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list