cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Loh Kok Jeng <kokjeng....@gmail.com>
Subject Re: Multipart Header Content-Location not Handled Correctly
Date Sat, 22 May 2010 04:25:25 GMT
I forgot to mention that I'm using CXF 2.2.5.

Below are the changes I made to solve the problem:

apache-cxf-2.2.5\rt\core\src\main\java\org\apache\cxf\attachment\AttachmentImpl.java

59c59,60
<         headers.put(name.toLowerCase(), value);
---
>         //headers.put(name.toLowerCase(), value);
>         headers.put(name, value);

apache-cxf-2.2.5\rt\frontend\jaxrs\src\main\java\org\apache\cxf\jaxrs\ext\MessageContextImpl.java

146,147c146,147
<             Attachment handler = (Attachment)handlers.get(i);
<             AttachmentImpl att = new
AttachmentImpl(handler.getContentId(), handler.getDataHandler());
---
>             Attachment handler = (Attachment)handlers.get(i);
>             AttachmentImpl att = new AttachmentImpl(handler.getContentId(), handler.getDataHandler());
148,149c149,150
<                 att.setHeader(key, att.getHeader(key));
---
>
>                 att.setHeader(key, handler.getHeader(key));





regards,
Loh Kok Jeng



On 22 May 2010 04:55, Sergey Beryozkin <sberyozkin@gmail.com> wrote:
> Hi
>
> Hi
>
> I'm pretty sure it is the same issue I've just talked about in the other
> email which I also believe has just been fixed...
>
>               GetMessage param = new GetMessage();
>>                try {
>>                        param.setMessageRefIdentifier(messageIdentifier);
>>                        attach = receiveclient.getMessage(param,
>> credentials);
>>
>>
> At this moment of time you have the attachments received with headers in
> lower-case
>
>
>>                        if (attach.hasNext()) {
>>                                while (attach.hasNext()) {
>>                                        MultivaluedMap<String,
String> map =
>> new MetadataMap<String, String>();
>>                                        AttachmentPartImpl impl
=
>> attach.next();
>>
>>                                        Iterator<MimeHeader>
itor =
>> impl.getAllMimeHeaders();
>>                                        while (itor.hasNext())
{
>>                                                MimeHeader
mimeHdr =
>> (MimeHeader) itor.next();
>>                                                map.add(mimeHdr.getName(),
>> mimeHdr.getValue());
>>                                        }
>>
>
> As suggested in the other email I can only think of the following workaround
> unless you can try 2.2.9-SNAPSHOT : get headers using well-known keys and
> set them using the same well-known keys (Content-ID, Content-Location, etc)
> hope it helps, Sergey
>
>
>> }
>>
>> regards,
>> KJLoh
>>
>

Mime
View raw message