Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9F5AED4B for ; Tue, 20 Nov 2012 09:33:34 +0000 (UTC) Received: (qmail 78043 invoked by uid 500); 20 Nov 2012 09:33:33 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 77283 invoked by uid 500); 20 Nov 2012 09:33:33 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 77159 invoked by uid 99); 20 Nov 2012 09:33:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2012 09:33:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sberyozkin@gmail.com designates 209.85.215.41 as permitted sender) Received: from [209.85.215.41] (HELO mail-la0-f41.google.com) (209.85.215.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2012 09:33:27 +0000 Received: by mail-la0-f41.google.com with SMTP id m15so2864946lah.0 for ; Tue, 20 Nov 2012 01:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=GXCgOhuNq66AnAA6vCcxSgHy1lm8gMEvezIwhsaxN0g=; b=M9Zje2jL0VoDf/6tnuLTaxHg7erk7wpwCTH6V1S/EmKKAQcGqO8rq8dTiiPQLGJZ4o QjxvspmjQtOkOyLJ3s8P84+Dur1CldQiVUA2oUsNaSy0ceB+khLaweA7dBcXvfXdHGFw rop0nfIQPiJBQEFssHQjRQ9mMZCV7rX12NPaLLR4RG9AHeCoAb+ltsL8BBFuHio3KMF/ iixyHW2bNleuR7imt2kESfOgA5JRnANaqQd01rUp2opFu6MmUkprEnSFQwSFnBv4YFxP SRqrt3zeqxRqFE2gyvrGh1km3XGnXehpZe9qf/8SJPO15+v1NSlUvpHhr1R6+14G2zKn 3KKw== Received: by 10.152.111.131 with SMTP id ii3mr13850831lab.37.1353403985542; Tue, 20 Nov 2012 01:33:05 -0800 (PST) Received: from [192.168.2.5] ([89.100.140.144]) by mx.google.com with ESMTPS id pz9sm4503625lab.11.2012.11.20.01.33.02 (version=SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:33:04 -0800 (PST) Message-ID: <50AB4E4C.8090409@gmail.com> Date: Tue, 20 Nov 2012 09:33:00 +0000 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: dev@cxf.apache.org Subject: Re: svn commit: r1411506 - /cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java References: <20121120015618.260DB2388980@eris.apache.org> <1E74D335-70E4-4B77-A1C6-97DA949F02A4@apache.org> <044008E6-52B0-478C-BA85-0539A45BFFFA@apache.org> <53583BA0-8012-4F2F-AC0A-3BC9666FEF44@gmail.com> In-Reply-To: <53583BA0-8012-4F2F-AC0A-3BC9666FEF44@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi On 20/11/12 02:40, Freeman Fang wrote: > Hi Dan, > > But if on unix/linux platform, if we have "\r\n", it interpret as two new line, which can cause some service providers can't handle the request, I think what we want should be a "new line" here, so use system property line.separator should be OK, please see the initial description from CXF-4482[1]. > IMHO it has to be 'attachment.line.separator' (to support the legacy providers or the ones which can not handle CR/LF) contextual property, using system property just won't work because we can have Unix on one end, Win on the other end, or vice versa Sergey > Btw, seems any jira update can't send out mail notification now. > > [1]https://issues.apache.org/jira/browse/CXF-4482 > > > Freeman > ------------- > Freeman(Yue) Fang > > Red Hat, Inc. > FuseSource is now part of Red Hat > Web: http://fusesource.com | http://www.redhat.com/ > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > http://blog.sina.com.cn/u/1473905042 > weibo: http://weibo.com/u/1473905042 > > On 2012-11-20, at 上午10:31, Daniel Kulp wrote: > >> >> Actually, more importantly, this makes the payload different depending on if its from Unix or Windows. According to the mid spec: >> >> http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html >> >> (section 7.2.1) >> >> it should always be a CRLF, so the code would be updated to always use that for the attachment boundaries. >> >> Dan >> >> >> >> On Nov 19, 2012, at 9:21 PM, Daniel Kulp wrote: >> >>> >>> Umm… don't use anything from sun.* packages. You can use org.apache.cxf.common.util.SystemPropertyAction if that works. >>> >>> >>> Dan >>> >>> >>> >>> On Nov 19, 2012, at 8:56 PM, ffang@apache.org wrote: >>> >>>> Author: ffang >>>> Date: Tue Nov 20 01:56:17 2012 >>>> New Revision: 1411506 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=1411506&view=rev >>>> Log: >>>> [CXF-4482]get line.separator system property ensure CR/LF works across platforms >>>> >>>> Modified: >>>> cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java >>>> >>>> Modified: cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java >>>> URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java?rev=1411506&r1=1411505&r2=1411506&view=diff >>>> ============================================================================== >>>> --- cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java (original) >>>> +++ cxf/trunk/api/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java Tue Nov 20 01:56:17 2012 >>>> @@ -153,7 +153,9 @@ public class AttachmentSerializer { >>>> encoding = "UTF-8"; >>>> } >>>> StringWriter writer = new StringWriter(); >>>> - writer.write("\n"); >>>> + String lineSeparator = java.security.AccessController.doPrivileged( >>>> + new sun.security.action.GetPropertyAction("line.separator")); >>>> + writer.write(lineSeparator); >>>> writer.write("--"); >>>> writer.write(bodyBoundary); >>>> >>>> >>>> >>> >>> -- >>> Daniel Kulp >>> dkulp@apache.org - http://dankulp.com/blog >>> Talend Community Coder - http://coders.talend.com >>> >> >> -- >> Daniel Kulp >> dkulp@apache.org - http://dankulp.com/blog >> Talend Community Coder - http://coders.talend.com >> > > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ Blog: http://sberyozkin.blogspot.com