Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 593CD10BBB for ; Wed, 15 Jan 2014 12:24:17 +0000 (UTC) Received: (qmail 17899 invoked by uid 500); 15 Jan 2014 12:24:15 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 17862 invoked by uid 500); 15 Jan 2014 12:24:14 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 17848 invoked by uid 99); 15 Jan 2014 12:24:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jan 2014 12:24:14 +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.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-wi0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jan 2014 12:24:07 +0000 Received: by mail-wi0-f179.google.com with SMTP id hr1so2054707wib.0 for ; Wed, 15 Jan 2014 04:23:43 -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=YBHzoxw2aOd3dNfXEFwBfe7n7BCacrmlVikl32NpY+o=; b=Ubk52vhUVhOsXIO+rvE3NqHktWgwkdDmSqLAPguiMY7w8a2yquPXBfUNAdq3Aw7F8w 43IzK3LB/+LJwxSFokl36PN/Ar3AIVImLjKZuH1pBbXT3q5xCBqcfMuO+aDuKrx8w2ze aw427FnG04dqQqn8RQKd+eymU1LYexSqTMKaGTlc7IdAerFc8Hh4yIzpWgfDtRBDER+Z IPGb55mgj6Sk34BTtCWVVjti6+Jv/YhTsONH7p4SQEf1Boa2t7GnfJ+WlCJ7X4bQ6qYL gDa9yDcy0xu3SRxWtf/hRNMboibNxsh2hah4QeO3DfRaLULRWD1VushOVHGAPv0Xfb9J mgyw== X-Received: by 10.180.85.6 with SMTP id d6mr300980wiz.48.1389788623389; Wed, 15 Jan 2014 04:23:43 -0800 (PST) Received: from [10.36.226.2] ([80.169.137.42]) by mx.google.com with ESMTPSA id kr10sm3127368wjc.22.2014.01.15.04.23.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Jan 2014 04:23:42 -0800 (PST) Message-ID: <52D67DCE.2080506@gmail.com> Date: Wed, 15 Jan 2014 12:23:42 +0000 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: Accessing temporary file name of attachments References: <2B0C5377-A082-4B36-AED6-3A884A42F906@kuluvalley.com> <8318ED09-0787-4AFB-A6ED-E036D0CC8A72@apache.org> <52D2DC9A.20609@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi On 14/01/14 21:19, Henry Clout wrote: > Hi Sergey. > > Sure, so long as it's possible for the service implementation to map an attachment to the the generated temp file, that'd work. I guess for the particular use case I was describing it's slightly less clean, since the user needs to take into account the fact that the data may be in memory rather than on disk. But then having access to the file itself is more flexible. What I've understood so far is that it is really an issue of the temporarily files stored in the locations which make it expensive and may be less secure to process the actual attachment stream. So suppose we have an application code accepting InputStream representing a given attachment part. IMHO the application code does not need to know or deal with the temporarily file which may have or not been created, the concern of the application is to read the available stream; as such I'm not really keen too on Attachment offering a transferFile operation, IMHO this is an extra concern for the application code :-) IMHO, offering the developers a chance to customize the way CachedOutputStream creates temporarily files will solve the problem under the hood, while the application code will just continue processing InputStream the high level way... Thanks, Sergey > > Yours, > Henry > > > On 12 Jan 2014, at 18:19, Sergey Beryozkin wrote: > >> Hi Henry, Dan, >> >> Should we offer an interface for users to create a temporary file instead ? >> For example, by default a temp file is created in the system temp drive, developers can customize it by creating a temp File in the right location and with the more user-friendly name if needed ? >> >> Cheers. Sergey