[jira] [Commented] (OFBIZ-9403) DataResourceWorker: New method getMimeTypeFromFileName(...) with extracted (refactored) code from getMimeType(...) method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-9403) DataResourceWorker: New method getMimeTypeFromFileName(...) with extracted (refactored) code from getMimeType(...) method

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-9403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16046041#comment-16046041 ]

Jacques Le Roux commented on OFBIZ-9403:
----------------------------------------

Hi Deepak, Martin,

Reading Deepak's comment, I had a mixed feeling, but after reading
https://softwareengineering.stackexchange.com/questions/132369/should-we-rename-overloaded-methods
https://blog.jooq.org/2015/07/28/java-8s-method-references-put-further-restrictions-on-overloading/
I tend to lean in favour of renaming :) A very moot point in this case anyway...

> DataResourceWorker: New method getMimeTypeFromFileName(...) with extracted (refactored) code from getMimeType(...) method
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-9403
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9403
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: content
>    Affects Versions: Trunk
>            Reporter: Martin Becker
>            Priority: Trivial
>         Attachments: OFBIZ-9403_DataResourceWorker-getMimeType.patch
>
>
> The method DataResourceWorker.getMimeType(GenericValue) has been refactored into two separate methods. The new additional method getMimeTypeFromFileName(Delegator,Filename) solely focuses on getting the MimeType from the file extension and is invoked by getMimeType(GenericValue) if needed. getMimeType returns the type if possible via the data resource. This results in cleaner code with the responsibility of both methods clearly defined by the methods names.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)