Return-Path: X-Original-To: apmail-poi-dev-archive@www.apache.org Delivered-To: apmail-poi-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 D47FECECE for ; Mon, 9 Jul 2012 09:19:07 +0000 (UTC) Received: (qmail 72178 invoked by uid 500); 9 Jul 2012 09:19:07 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 71958 invoked by uid 500); 9 Jul 2012 09:19:04 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Delivered-To: moderator for dev@poi.apache.org Received: (qmail 37558 invoked by uid 99); 9 Jul 2012 05:13:09 -0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.236.26 is neither permitted nor denied by domain of sachintrue@gmail.com) Date: Sun, 8 Jul 2012 22:12:42 -0700 (PDT) From: lucaro To: dev@poi.apache.org Message-ID: <1341810762689-5710407.post@n5.nabble.com> In-Reply-To: <1341573744553-5710382.post@n5.nabble.com> References: <1341573744553-5710382.post@n5.nabble.com> Subject: Re: Removing attachments from .MSG file MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Nitin I am posting the code snippet here POIFSFileSystem newDoc = new POIFSFileSystem(); POIFSFileSystem poifs = new POIFSFileSystem(new FileInputStream(new File("fileName"))); for(Entry entry : poifs.getRoot()){ if(! entry.getName().startsWith(AttachmentChunks.PREFIX)) { EntryUtils.copyNodeRecursively(entry, newDoc.getRoot()); } } File fToWrite = new File("C:/CR0040POC/detachedMail/"+msgFile); OutputStream out = new FileOutputStream(fToWrite); newDoc.writeFilesystem(out); out.close(); -- View this message in context: http://apache-poi.1045710.n5.nabble.com/Removing-attachments-from-MSG-file-tp5710382p5710407.html Sent from the POI - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional commands, e-mail: dev-help@poi.apache.org