本文整理了Java中javax.mail.Message.getMessageNumber()
方法的一些代码示例,展示了Message.getMessageNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMessageNumber()
方法的具体详情如下:
包路径:javax.mail.Message
类名称:Message
方法名:getMessageNumber
[英]Get the Message number for this Message. A Message object's message number is the relative position of this Message in its Folder. Note that the message number for a particular Message can change during a session if other messages in the Folder are deleted and expunged.
Valid message numbers start at 1. Messages that do not belong to any folder (like newly composed or derived messages) have 0 as their message number.
[中]获取此邮件的邮件号码。消息对象的消息编号是此消息在其文件夹中的相对位置。请注意,如果文件夹中的其他邮件被删除或删除,则特定邮件的邮件编号可能会在会话期间更改。
有效的消息编号从1开始。不属于任何文件夹的邮件(如新撰写的或派生的邮件)的邮件编号为0。
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Export message content to a filename.
*
* @param filename
* the target filename
* @param foldername
* the parent folder of filename
* @throws KettleException
*/
public void saveMessageContentToFile( String filename, String foldername ) throws KettleException {
OutputStream os = null;
try {
os = KettleVFS.getOutputStream( foldername + ( foldername.endsWith( "/" ) ? "" : "/" ) + filename, false );
getMessage().writeTo( os );
updateSavedMessagesCounter();
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "MailConnection.Error.SavingMessageContent", ""
+ this.message.getMessageNumber(), filename, foldername ), e );
} finally {
if ( os != null ) {
IOUtils.closeQuietly( os );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Delete current fetched message
*
* @throws KettleException
*/
public void deleteMessage() throws KettleException {
try {
this.message.setFlag( Flags.Flag.DELETED, true );
updateDeletedMessagesCounter();
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "MailConnection.Error.DeletingMessage", ""
+ getMessage().getMessageNumber() ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Before
public void before() throws IOException, KettleException, MessagingException {
MockitoAnnotations.initMocks( this );
Mockito.when( parentJob.getLogLevel() ).thenReturn( LogLevel.BASIC );
entry.setParentJob( parentJob );
entry.setSaveMessage( true );
Mockito.when( message.getMessageNumber() ).thenReturn( 1 );
Mockito.when( message.getContent() ).thenReturn( createMessageContent() );
Mockito.when( mailConn.getMessage() ).thenReturn( message );
Mockito.doNothing().when( mailConn ).openFolder( Mockito.anyBoolean() );
Mockito.doNothing().when( mailConn ).openFolder( Mockito.anyString(), Mockito.anyBoolean() );
Mockito.when( mailConn.getMessagesCount() ).thenReturn( 1 );
}
代码示例来源:origin: pentaho/pentaho-kettle
r[index] = new Long( message.getMessageNumber() );
break;
case MailInputField.COLUMN_SUBJECT:
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Save attached files to a folder.
*
* @param foldername
* the target foldername
* @param pattern
* regular expression to filter on files
* @throws KettleException
*/
public void saveAttachedFiles( String foldername, Pattern pattern ) throws KettleException {
Object content = null;
try {
content = getMessage().getContent();
if ( content instanceof Multipart ) {
handleMultipart( foldername, (Multipart) content, pattern );
}
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "MailConnection.Error.SavingAttachedFiles", ""
+ this.message.getMessageNumber(), foldername ), e );
} finally {
if ( content != null ) {
content = null;
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Move current message to a target folder. (IMAP) You must call setDestinationFolder before calling this method
*
* @throws KettleException
*/
public void moveMessage() throws KettleException {
try {
// move all messages
this.folder.copyMessages( new Message[] { this.message }, this.destinationIMAPFolder );
updatedMovedMessagesCounter();
// Make sure to delete messages
deleteMessage();
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString( PKG, "MailConnection.Error.MovingMessage", ""
+ getMessage().getMessageNumber(), this.destinationIMAPFolder.getName() ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
logDebug( BaseMessages.getString( PKG, "MailInput.Log.FetchingMessage", message.getMessageNumber() ) );
代码示例来源:origin: pentaho/pentaho-kettle
when( message.getMessageNumber() ).thenReturn( MSG_NUMB );
when( message.getSubject() ).thenReturn( SUBJ );
代码示例来源:origin: pentaho/pentaho-kettle
if ( log.isDetailed() ) {
log.logDetailed( BaseMessages.getString( PKG, "JobGetMailsFromPOP.AttachedFileSaved", filename, ""
+ getMessage().getMessageNumber(), foldername ) );
代码示例来源:origin: pentaho/pentaho-kettle
+ this.message.getMessageNumber() ), e );
} finally {
if ( content != null ) {
代码示例来源:origin: com.sun.mail/javax.mail
@Override
public int compare(Message msg1, Message msg2) {
return msg1.getMessageNumber() - msg2.getMessageNumber();
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
public int compare(Message msg1, Message msg2) {
return msg1.getMessageNumber() - msg2.getMessageNumber();
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* The match method.
*
* @param msg the Message number is matched with this Message
* @return true if the match succeeds, otherwise false
*/
public boolean match(Message msg) {
int msgno;
try {
msgno = msg.getMessageNumber();
} catch (Exception e) {
return false;
}
return super.match(msgno);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* The match method.
*
* @param msg the Message number is matched with this Message
* @return true if the match succeeds, otherwise false
*/
@Override
public boolean match(Message msg) {
int msgno;
try {
msgno = msg.getMessageNumber();
} catch (Exception e) {
return false;
}
return super.match(msgno);
}
代码示例来源:origin: oblac/jodd
messageNumber(msg.getMessageNumber());
代码示例来源:origin: camunda/camunda-bpm-platform
mnum[i] = msgs[i].getMessageNumber();
Arrays.sort(mnum);
代码示例来源:origin: com.sun.mail/javax.mail
mnum[i] = msgs[i].getMessageNumber();
Arrays.sort(mnum);
代码示例来源:origin: pentaho/pentaho-kettle
int messagenumber = mailConn.getMessage().getMessageNumber();
boolean okPOP3 = usePOP3 ? true : false; // (mailConn.getMessagesCounter()<nbrmailtoretrieve &&
代码示例来源:origin: camunda/camunda-bpm-platform
Message[] msgs = createMessagesForUIDs(luid);
for (Message m : msgs) {
if (m.getMessageNumber() > 0)
messageCache.expungeMessage(m.getMessageNumber());
代码示例来源:origin: com.sun.mail/javax.mail
Message[] msgs = createMessagesForUIDs(luid);
for (Message m : msgs) {
if (m.getMessageNumber() > 0)
messageCache.expungeMessage(m.getMessageNumber());
内容来源于网络,如有侵权,请联系作者删除!