/** * Get the preamble text, if any, that appears before the * first body part of this multipart. Some protocols, * such as IMAP, will not allow access to the preamble text. * * @return the preamble text, or null if no preamble * @exception MessagingException for failures * @since JavaMail 1.4 */ public synchronized String getPreamble() throws MessagingException { parse(); return preamble; }
/** * Get the preamble text, if any, that appears before the * first body part of this multipart. Some protocols, * such as IMAP, will not allow access to the preamble text. * * @return the preamble text, or null if no preamble * @exception MessagingException for failures * @since JavaMail 1.4 */ public synchronized String getPreamble() throws MessagingException { parse(); return preamble; }
/** * Return true if the final boundary line for this * multipart was seen. When parsing multipart content, * this class will (by default) terminate parsing with * no error if the end of input is reached before seeing * the final multipart boundary line. In such a case, * this method will return false. (If the System property * "mail.mime.multipart.ignoremissingendboundary" is set to * false, parsing such a message will instead throw a * MessagingException.) * * @return true if the final boundary line was seen * @exception MessagingException for failures * @since JavaMail 1.4 */ public synchronized boolean isComplete() throws MessagingException { parse(); return complete; }
/** * Return true if the final boundary line for this * multipart was seen. When parsing multipart content, * this class will (by default) terminate parsing with * no error if the end of input is reached before seeing * the final multipart boundary line. In such a case, * this method will return false. (If the System property * "mail.mime.multipart.ignoremissingendboundary" is set to * false, parsing such a message will instead throw a * MessagingException.) * * @return true if the final boundary line was seen * @exception MessagingException for failures * @since JavaMail 1.4 */ public synchronized boolean isComplete() throws MessagingException { parse(); return complete; }
/** * Adds a Part to the multipart. The BodyPart is appended to * the list of existing Parts. * * @param part The Part to be appended * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ public synchronized void addBodyPart(BodyPart part) throws MessagingException { parse(); super.addBodyPart(part); }
/** * Adds a Part to the multipart. The BodyPart is appended to * the list of existing Parts. * * @param part The Part to be appended * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ @Override public synchronized void addBodyPart(BodyPart part) throws MessagingException { parse(); super.addBodyPart(part); }
/** * Adds a BodyPart at position <code>index</code>. * If <code>index</code> is not the last one in the list, * the subsequent parts are shifted up. If <code>index</code> * is larger than the number of parts present, the * BodyPart is appended to the end. * * @param part The BodyPart to be inserted * @param index Location where to insert the part * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ public synchronized void addBodyPart(BodyPart part, int index) throws MessagingException { parse(); super.addBodyPart(part, index); }
/** * Adds a BodyPart at position <code>index</code>. * If <code>index</code> is not the last one in the list, * the subsequent parts are shifted up. If <code>index</code> * is larger than the number of parts present, the * BodyPart is appended to the end. * * @param part The BodyPart to be inserted * @param index Location where to insert the part * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ @Override public synchronized void addBodyPart(BodyPart part, int index) throws MessagingException { parse(); super.addBodyPart(part, index); }
/** * Return the number of enclosed BodyPart objects. * * @return number of parts */ public synchronized int getCount() throws MessagingException { parse(); return super.getCount(); }
/** * Get the specified BodyPart. BodyParts are numbered starting at 0. * * @param index the index of the desired BodyPart * @return the Part * @exception MessagingException if no such BodyPart exists */ public synchronized BodyPart getBodyPart(int index) throws MessagingException { parse(); return super.getBodyPart(index); }
/** * Return the number of enclosed BodyPart objects. * * @return number of parts */ @Override public synchronized int getCount() throws MessagingException { parse(); return super.getCount(); }
/** * Get the specified BodyPart. BodyParts are numbered starting at 0. * * @param index the index of the desired BodyPart * @return the Part * @exception MessagingException if no such BodyPart exists */ @Override public synchronized BodyPart getBodyPart(int index) throws MessagingException { parse(); return super.getBodyPart(index); }
/** * Remove the specified part from the multipart message. * Shifts all the parts after the removed part down one. * * @param part The part to remove * @return true if part removed, false otherwise * @exception MessagingException if no such Part exists * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values */ public boolean removeBodyPart(BodyPart part) throws MessagingException { parse(); return super.removeBodyPart(part); }
/** * Remove the part at specified location (starting from 0). * Shifts all the parts after the removed part down one. * * @param index Index of the part to remove * @exception IndexOutOfBoundsException if the given index * is out of range. * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ public void removeBodyPart(int index) throws MessagingException { parse(); super.removeBodyPart(index); }
/** * Remove the specified part from the multipart message. * Shifts all the parts after the removed part down one. * * @param part The part to remove * @return true if part removed, false otherwise * @exception MessagingException if no such Part exists * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values */ @Override public boolean removeBodyPart(BodyPart part) throws MessagingException { parse(); return super.removeBodyPart(part); }
/** * Remove the part at specified location (starting from 0). * Shifts all the parts after the removed part down one. * * @param index Index of the part to remove * @exception IndexOutOfBoundsException if the given index * is out of range. * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception MessagingException for other failures */ @Override public void removeBodyPart(int index) throws MessagingException { parse(); super.removeBodyPart(index); }
/** * Update headers. The default implementation here just * calls the <code>updateHeaders</code> method on each of its * children BodyParts. <p> * * Note that the boundary parameter is already set up when * a new and empty MimeMultipart object is created. <p> * * This method is called when the <code>saveChanges</code> * method is invoked on the Message object containing this * Multipart. This is typically done as part of the Message * send process, however note that a client is free to call * it any number of times. So if the header updating process is * expensive for a specific MimeMultipart subclass, then it * might itself want to track whether its internal state actually * did change, and do the header updating only if necessary. * * @exception MessagingException for failures */ protected synchronized void updateHeaders() throws MessagingException { parse(); for (int i = 0; i < parts.size(); i++) ((MimeBodyPart)parts.elementAt(i)).updateHeaders(); }
/** * Update headers. The default implementation here just * calls the <code>updateHeaders</code> method on each of its * children BodyParts. <p> * * Note that the boundary parameter is already set up when * a new and empty MimeMultipart object is created. <p> * * This method is called when the <code>saveChanges</code> * method is invoked on the Message object containing this * Multipart. This is typically done as part of the Message * send process, however note that a client is free to call * it any number of times. So if the header updating process is * expensive for a specific MimeMultipart subclass, then it * might itself want to track whether its internal state actually * did change, and do the header updating only if necessary. * * @exception MessagingException for failures */ protected synchronized void updateHeaders() throws MessagingException { parse(); for (int i = 0; i < parts.size(); i++) ((MimeBodyPart)parts.elementAt(i)).updateHeaders(); }
/** * Get the MimeBodyPart referred to by the given ContentID (CID). * Returns null if the part is not found. * * @param CID the ContentID of the desired part * @return the Part * @exception MessagingException for failures */ public synchronized BodyPart getBodyPart(String CID) throws MessagingException { parse(); int count = getCount(); for (int i = 0; i < count; i++) { MimeBodyPart part = (MimeBodyPart)getBodyPart(i); String s = part.getContentID(); if (s != null && s.equals(CID)) return part; } return null; }
/** * Get the MimeBodyPart referred to by the given ContentID (CID). * Returns null if the part is not found. * * @param CID the ContentID of the desired part * @return the Part * @exception MessagingException for failures */ public synchronized BodyPart getBodyPart(String CID) throws MessagingException { parse(); int count = getCount(); for (int i = 0; i < count; i++) { MimeBodyPart part = (MimeBodyPart)getBodyPart(i); String s = part.getContentID(); if (s != null && s.equals(CID)) return part; } return null; }