本文整理汇总了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);
}