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

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

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

MimeMessage.setFlags介绍

[英]Set the flags for this message.

This implementation modifies the flags field.
[中]设置此消息的标志。
此实现修改flags字段。

代码示例

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
@Override
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

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

setFlags(answeredFlag, true);
} catch (MessagingException mex) {

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

setFlags(answeredFlag, true);
} catch (MessagingException mex) {

代码示例来源:origin: org.mnode.mstor/mstor

/**
 * {@inheritDoc}
 */
public synchronized void setFlags(final Flags flags, final boolean set)
    throws MessagingException {
  super.setFlags(flags, set);
  // copy updated flags from mime message implementation..
  updateFlags();
}

代码示例来源:origin: de.saly/javamail-mock2-fullmock

@Override
public synchronized void setFlags(final Flags flag, final boolean set) throws MessagingException {
  super.setFlags(flag, set);
  if (flagChangeListener != null) {
    flagChangeListener.onFlagChange(this, flag, set);
  }
}

代码示例来源:origin: salyh/javamail-mock2

@Override
public synchronized void setFlags(final Flags flag, final boolean set) throws MessagingException {
  super.setFlags(flag, set);
  if (flagChangeListener != null) {
    flagChangeListener.onFlagChange(this, flag, set);
  }
}

代码示例来源:origin: greenmail-mail-test/greenmail

public void setFlags(Flags flags, boolean value) {
  try {
    getMimeMessage().setFlags(flags, value);
  } catch (MessagingException e) {
    throw new IllegalStateException("Can not set flags " + flags + " to " + value, e);
  }
}

代码示例来源:origin: org.apache.james/james-server-core-library

/**
 * @see javax.mail.Message#setFlags(javax.mail.Flags, boolean)
 */
public void setFlags(Flags flag, boolean set) throws MessagingException {
  getWrappedMessageForWriting().setFlags(flag, set);
}

代码示例来源:origin: de.saly/javamail-mock2-halfmock

@Override
public synchronized void setFlags(final Flags flag, final boolean set) throws MessagingException {
  super.setFlags(flag, set);
  if (flagChangeListener != null) {
    flagChangeListener.onFlagChange(this, flag, set);
  }
}

代码示例来源:origin: stackoverflow.com

MimeMessage mimeMessage = new MimeMessage((MimeMessage) message);
Flags flags = mimeMessage.getFlags();
mimeMessage.setFlags(flags, false);

代码示例来源:origin: org.apache.geronimo.javamail/geronimo-javamail_1.3.1_provider

public void setFlags(Flags newFlags, boolean set) throws MessagingException {
  Flags oldFlags = (Flags) flags.clone();
  super.setFlags(newFlags, set);
  if (!flags.equals(oldFlags)) {
    ((POP3Folder) folder).notifyMessageChangedListeners(MessageChangedEvent.FLAGS_CHANGED, this);
  }
}

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
@Override
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
public void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
@Override
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

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

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
@Override
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param newFlags    the flags to be set
 * @param set    the value to be set
 */
@Override
public synchronized void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags))
  folder.notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}

代码示例来源:origin: org.apache.geronimo.javamail/geronimo-javamail_1.4_provider

/**
 * Set a flag value for this Message.  The flags are 
 * only set locally, not the server.  When the folder 
 * is closed, any messages with the Deleted flag set 
 * will be removed from the server. 
 * 
 * @param newFlags The new flag values.
 * @param set      Indicates whether this is a set or an unset operation.
 * 
 * @exception MessagingException
 */
public void setFlags(Flags newFlags, boolean set) throws MessagingException {
  Flags oldFlags = (Flags) flags.clone();
  super.setFlags(newFlags, set);
  if (!flags.equals(oldFlags)) {
    ((POP3Folder) folder).notifyMessageChangedListeners(MessageChangedEvent.FLAGS_CHANGED, this);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

/**
 * Set the specified flags on this message to the specified value.
 *
 * @param flags    the flags to be set
 * @param set    the value to be set
 */
public void setFlags(Flags newFlags, boolean set)
      throws MessagingException {
Flags oldFlags = (Flags)flags.clone();
super.setFlags(newFlags, set);
if (!flags.equals(oldFlags)) {
  setHeadersFromFlags();
  if (folder != null)
  ((MboxFolder)folder).notifyMessageChangedListeners(
      MessageChangedEvent.FLAGS_CHANGED, this);
}
}

相关文章

MimeMessage类方法