Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 607 invoked from network); 20 Mar 2008 22:44:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Mar 2008 22:44:40 -0000 Received: (qmail 45947 invoked by uid 500); 20 Mar 2008 22:44:37 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 45817 invoked by uid 500); 20 Mar 2008 22:44:37 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 45806 invoked by uid 500); 20 Mar 2008 22:44:37 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 45803 invoked by uid 99); 20 Mar 2008 22:44:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2008 15:44:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Mar 2008 22:44:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6DE031A9832; Thu, 20 Mar 2008 15:44:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r639491 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Date: Thu, 20 Mar 2008 22:44:17 -0000 To: axis2-cvs@ws.apache.org From: nthaker@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080320224418.6DE031A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: nthaker Date: Thu Mar 20 15:44:16 2008 New Revision: 639491 URL: http://svn.apache.org/viewvc?rev=639491&view=rev Log: Axis2-3644 Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?rev=639491&r1=639490&r2=639491&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Thu Mar 20 15:44:16 2008 @@ -22,6 +22,7 @@ import org.apache.axiom.attachments.Attachments; import org.apache.axiom.attachments.CachedFileDataSource; +import org.apache.axiom.attachments.lifecycle.LifecycleManager; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMOutputFormat; @@ -36,6 +37,7 @@ import org.apache.axis2.builder.Builder; import org.apache.axis2.builder.BuilderUtil; import org.apache.axis2.context.MessageContext; +import org.apache.axis2.deployment.DeploymentConstants; import org.apache.axis2.description.Parameter; import org.apache.axis2.i18n.Messages; import org.apache.axis2.transport.http.ApplicationXMLFormatter; @@ -479,7 +481,8 @@ } Attachments attachments = msgContext.getAttachmentMap(); - if (attachments != null && BuilderUtil.isAttachmentsCacheEnabled(msgContext)) { + LifecycleManager lcm = (LifecycleManager)msgContext.getRootContext().getAxisConfiguration().getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER); + if (attachments != null) { String [] keys = attachments.getAllContentIDs(); if (keys != null) { String key = null; @@ -493,13 +496,33 @@ file = ((CachedFileDataSource)dataSource).getFile(); if (log.isDebugEnabled()) { log.debug("Delete cache attachment file: "+file.getName()); - } - file.delete(); + } + if(lcm!=null){ + if(log.isDebugEnabled()){ + log.debug("deleting file using lifecyclemanager"); + } + lcm.delete(file); + }else{ + file.delete(); + } } } catch (Exception e) { + if (log.isDebugEnabled()) { + log.debug("Delete cache attachment file failed"+ e.getMessage()); + } + if (file != null) { - file.deleteOnExit(); + if(lcm!=null){ + try{ + lcm.deleteOnExit(file); + }catch(Exception ex){ + file.deleteOnExit(); + } + } + else{ + file.deleteOnExit(); + } } } } --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org