geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hendrik Saly (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GERONIMO-4594) The javamail provider should have a way to decode attachment names
Date Tue, 25 Nov 2014 21:21:13 GMT

     [ https://issues.apache.org/jira/browse/GERONIMO-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hendrik Saly resolved GERONIMO-4594.
------------------------------------
    Resolution: Fixed

Resolved with rev 1641698

> The javamail provider should have a way to decode attachment names
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-4594
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4594
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Guillaume Nodet
>            Assignee: Hendrik Saly
>
> Something has been written in the api, but not for the provider.
> The IMAPMimeBodyPart code follows:
> {code}
>     public String getFileName() throws MessagingException {
>         String filename = bodyStructure.disposition.getParameter("filename");
>         if (filename == null) {
>             filename = bodyStructure.mimeType.getParameter("name");
>         }
>         return filename;
>     }
> {code}
> I think it should be more something like:
> {code}
>     public String getFileName() throws MessagingException {
>         String filename = bodyStructure.disposition.getParameter("filename");
>         if (filename == null) {
>             filename = bodyStructure.mimeType.getParameter("name");
>         }
>         if (filename != null && SessionUtil.getBooleanProperty(MIME_DECODEFILENAME,
false)) {
>             try {
>                 filename = MimeUtility.decodeText(filename);
>             } catch (UnsupportedEncodingException e) {
>                 throw new MessagingException("Unable to decode filename", e);
>             }
>         }
>         return filename;
>     }
> {code}
> With the MIME_DECODEFILENAME being the same property as in the javax.mail.internet.MimeBodyPart
from the specs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message