You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "kyle o (JIRA)" <ji...@apache.org> on 2015/04/21 18:41:59 UTC

[jira] [Created] (CXF-6364) Large Temporary Files Aren't Deleted After DataHandler InputStream Close

kyle o created CXF-6364:
---------------------------

             Summary: Large Temporary Files Aren't Deleted After DataHandler InputStream Close
                 Key: CXF-6364
                 URL: https://issues.apache.org/jira/browse/CXF-6364
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.3
         Environment: Occurs on Ubuntu and Windows
            Reporter: kyle o


This appears to be a re-occurrence of CXF-2016 (https://issues.apache.org/jira/browse/CXF-2106). I'm closing the DataHandler InputStream, but the temporary file isn't being deleted.

Sample code:
if (null != message.getAttachments()) {
	Collection<Attachment> attachmentCollection = message.getAttachments();
	
	if (attachmentCollection.size() > 0) {
		for (Attachment attachment : attachmentCollection) {
			
			DataHandler handler = attachment.getDataHandler();
			
			if (null != handler.getInputStream()) {
				attachmentMap.put(attachment.getId(), Utils.convertStreamToString(handler.getInputStream()));
			}
			
			if(handler != null)
				if(handler.getInputStream() != null)
					handler.getInputStream().close();
			
		}
	}
}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)