javax.mail.internet.MimeMultipart.parse()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中javax.mail.internet.MimeMultipart.parse()方法的一些代码示例,展示了MimeMultipart.parse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMultipart.parse()方法的具体详情如下:
包路径:javax.mail.internet.MimeMultipart
类名称:MimeMultipart
方法名:parse

MimeMultipart.parse介绍

[英]Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts. The parsed flag is set to true, and if true on entry nothing is done. This method is called by all other methods that need data for the body parts, to make sure the data has been parsed. The #initializeProperties method is called before parsing the data.
[中]解析数据源中的输入流,构造适当的MimeBodyParts。parsed标志设置为true,如果条目为true,则不会执行任何操作。所有其他需要身体部位数据的方法都会调用此方法,以确保数据已被解析。在解析数据之前调用#initializeProperties方法。

代码示例

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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;
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Return the number of enclosed BodyPart objects.
 *
 * @return        number of parts
 */
public synchronized int getCount() throws MessagingException {
parse();
return super.getCount();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Return the number of enclosed BodyPart objects.
 *
 * @return        number of parts
 */
@Override
public synchronized int getCount() throws MessagingException {
parse();
return super.getCount();
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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();
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 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;
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * 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;
}

相关文章