cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Han Hong Fang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4574) Incorrect return type of AttachmentPart.getContent()
Date Fri, 19 Oct 2012 06:52:03 GMT

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

Han Hong Fang commented on CXF-4574:
------------------------------------

I did some quick debugging, and found that the ByteArrayInputStream returned from AttachmentPart.getContent()
is created in LoadingByteArrayOutputStream.createInputStream().

Did I locate the java code incorrectly?
                
> Incorrect return type of AttachmentPart.getContent()
> ----------------------------------------------------
>
>                 Key: CXF-4574
>                 URL: https://issues.apache.org/jira/browse/CXF-4574
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.6.2
>         Environment: Windows 7 + Oracle jdk 1.6.0_29
>            Reporter: Han Hong Fang
>            Assignee: Freeman Fang
>
> The java doc of javax.xml.soap.AttachmentPart.getContent() says:
> Gets the content of this AttachmentPart object as a Java object. The type of the returned
Java object depends on (1) the DataContentHandler object that is used to interpret the bytes
and (2) the Content-Type given in the header.
> For the MIME content types "text/plain", "text/html" and "text/xml", the DataContentHandler
object does the conversions to and from the Java types corresponding to the MIME types. For
other MIME types,the DataContentHandler object can return an InputStream object that contains
the content data as raw bytes.
> A SAAJ-compliant implementation must, as a minimum, return a java.lang.String object
corresponding to any content stream with a Content-Type value of text/plain, a javax.xml.transform.stream.StreamSource
object corresponding to a content stream with a Content-Type value of text/xml, a java.awt.Image
object corresponding to a content stream with a Content-Type value of image/gif or image/jpeg.
For those content types that an installed DataContentHandler object does not understand, the
DataContentHandler object is required to return a java.io.InputStream object with the raw
bytes. 
> But in cxf 2.6.2, when MIME content type is "text/xml", the return type of AttachmentPart.getContent()
is java.io.ByteArrayInputStream, which doesn't comply with the java doc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message