本文整理匯總了Java中javax.mail.Message.getSize方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.getSize方法的具體用法?Java Message.getSize怎麽用?Java Message.getSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.mail.Message
的用法示例。
在下文中一共展示了Message.getSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getEmail
import javax.mail.Message; //導入方法依賴的package包/類
public void getEmail() throws MessagingException, IOException {
Session session = Session.getDefaultInstance(System.getProperties(),null);
Store store = null;
store = session.getStore("imaps");
// store.connect(this.host, this.userName, this.password);
// Get default folder
Folder folder = store.getDefaultFolder();
folder.getMessages();
folder.getNewMessageCount();
Message m = folder.getMessage(0);
m.getMessageNumber();
m.getAllRecipients();
m.getReceivedDate();
m.getFrom();
m.getSubject();
m.getReplyTo();
m.getContent();
m.getSize();
// Get any folder by name
Folder[] folderList = folder.list();
}
示例2: MessageData
import javax.mail.Message; //導入方法依賴的package包/類
/**
* Create a new MessageData object given the message object.
*/
public MessageData(Message message) throws MessagingException
{
_message = message;
// cache the size just because it involves a calculation
_size = message.getSize() / 1024;
// cache this since the folder has to be open to get this:
_isRead = _message.isSet(Flag.SEEN);
_isDeleted = _message.isSet(Flag.DELETED);
}