Hi

This is related to
https://issues.apache.org/jira/browse/CXF-4348?focusedCommentId=13488120&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13488120

The only multipart/* media type that may contain 'start' and 'start-info' attributes is, AFAIK, multipart/related.

Are you aware of any texts that support these attributes for multipart/mixed ? Even if it not but you do need these attributes when processing multipart/mixed payloads then may be we can update the code to set them but only if a property requesting it is set, let me know please

Sergey

On 04/01/16 18:40, Jacob Zwiers wrote:

After upgrading Apache CXF from 2.4.0 to 3.4.1, the `Content-Type` header on 
responses from JAX-RS methods have dropped several attributes.

Under CXF 2.4.0, the header is:

     Content-Type: multipart/mixed; type="application/octet-stream"; 
boundary="uuid:61b631f1-0aa9-4cc8-ad85-3c09129ec442"; start="<DocumentName.ext>"; 
start-info="application/octet-stream"

Under CXF 3.4.1, it is:

     Content-Type: multipart/mixed; 
boundary="uuid:804168d7-70ed-44e7-a471-9647372b9224"

Note: attributes `type`, `start`, `start-info` missing.

Here's the code we're using:

     @GET
     @Path( "{order_id}/document/{document_id}/file" )
     @Produces("multipart/mixed")
     public MultipartBody getDocument( @PathParam( "order_id") int _orderId,  @PathParam( 
"document_id") int _documentId) throws Exception {

        FileInfo fileInfo = findFileInfo( _orderId, _documentId );

        List<Attachment> atts = new ArrayList<Attachment>();

        File internalFile = fileInfo.getActualFile();

        String fileName = fileInfo.getOriginalDocumentName();

        String fileSize = String.valueOf( internalFile.length() );

        ContentDisposition cd = new ContentDisposition("attachment; filename=\"" + fileName + 
"\"; size=" + fileSize );

        InputStream inputStreamToUse = new FileInputStream( internalFile );

        Attachment att = new Attachment(fileName, inputStreamToUse, cd);

        atts.add( att );

        return new MultipartBody(atts, true);   
     }

I can't find any references in the [Migration Guides][1] to changes in this 
area and the style of the above method seems to match the one from the 
[getBooks2() method in the JAX-RS Multipart documentation][2].

Any guidance on what might be causing the different behaviour?

   [1]: http://cxf.apache.org/docs/migration-guides.html
   [2]: http://cxf.apache.org/docs/jax-rs-multiparts.html#highlighter_731760



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to