325N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * Represents an attachment part in a MIME message. MIME message parsing is done 325N/A * lazily using a pull parser, so the part may not have all the data. {@link #read} 325N/A * and {@link #readOnce} may trigger the actual parsing the message. In fact, 325N/A * parsing of an attachment part may be triggered by calling {@link #read} methods 325N/A * on some other attachemnt parts. All this happens behind the scenes so the 325N/A * application developer need not worry about these details. 325N/A * @author Jitendra Kotamraju 325N/A * Can get the attachment part's content multiple times. That means 325N/A * the full content needs to be there in memory or on the file system. 325N/A * Calling this method would trigger parsing for the part's data. So 325N/A * do not call this unless it is required(otherwise, just wrap MIMEPart 325N/A * into a object that returns InputStream for e.g DataHandler) 325N/A * @return data for the part's content 325N/A * Cleans up any resources that are held by this part (for e.g. deletes 325N/A * the temp file that is used to serve this part's content). After 325N/A * calling this, one shouldn't call {@link #read()} or {@link #readOnce()} 325N/A * Can get the attachment part's content only once. The content 325N/A * will be lost after the method. Content data is not be stored 325N/A * on the file system or is not kept in the memory for the 325N/A * - Attachement parts contents are accessed sequentially 325N/A * In general, take advantage of this when the data is used only 325N/A * @return data for the part's content 325N/A * Returns Content-ID MIME header for this attachment part 325N/A * @return Content-ID of the part 325N/A * Returns Content-Type MIME header for this attachment part 325N/A * @return Content-Type of the part 325N/A // Trigger parsing for the part headers 325N/A * Return all the values for the specified header. 325N/A * Returns <code>null</code> if no headers with the 325N/A * specified name exist. 325N/A * @param name header name 325N/A * @return list of header values, or null if none 325N/A * Return all the headers 325N/A * @return list of Header objects 325N/A * Callback to set headers 325N/A * @param headers MIME headers for the part 325N/A * Callback to notify that there is a partial content for the part 325N/A * @param buf content data for the part 325N/A * Callback to indicate that parsing is done for this part 325N/A * (no more update events for this part) 325N/A * Callback to set Content-ID for this part 325N/A * @param cid Content-ID of the part