Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16C2761B0 for ; Wed, 18 May 2011 09:52:06 +0000 (UTC) Received: (qmail 19170 invoked by uid 500); 18 May 2011 09:52:06 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 19049 invoked by uid 500); 18 May 2011 09:52:05 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 19039 invoked by uid 99); 18 May 2011 09:52:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 09:52:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2011 09:52:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DEADD2388A2C; Wed, 18 May 2011 09:51:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1124152 - in /cxf/branches/2.3.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Date: Wed, 18 May 2011 09:51:41 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110518095141.DEADD2388A2C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Wed May 18 09:51:41 2011 New Revision: 1124152 URL: http://svn.apache.org/viewvc?rev=1124152&view=rev Log: Merged revisions 1104697 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1104697 | ffang | 2011-05-18 14:28:11 +0800 (δΈ‰, 18 5 2011) | 1 line [CXF-3505]CXF attachment doesn't compatible with SUN's ACTIVATION library ........ Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1124152&r1=1124151&r2=1124152&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original) +++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Wed May 18 09:51:41 2011 @@ -285,9 +285,9 @@ public final class AttachmentUtil { } catch (UnsupportedEncodingException ue) { contentId = contentId.substring(4); } - return new LazyDataSource(contentId, atts); + return loadDataSource(contentId, atts); } else if (contentId.indexOf("://") == -1) { - return new LazyDataSource(contentId, atts); + return loadDataSource(contentId, atts); } else { try { return new URLDataSource(new URL(contentId)); @@ -297,5 +297,12 @@ public final class AttachmentUtil { } } + + private static DataSource loadDataSource(String contentId, Collection atts) { + LazyDataSource lazyDS = new LazyDataSource(contentId, atts); + //ensure the attachment DS is loaded to make it also work with SUN's activation lib + lazyDS.getContentType(); + return lazyDS; + } }