@Test public void testSetNew() throws IOException, MessagingException, PasswordException, GeneralSecurityException { folder1.add(email1); FolderIterator<Email> iterator = folder1.iterate(); Email emailFromFolder = iterator.next(); assertEquals("\"unread\" flag is false after adding email to folder!", emailFromFolder.isUnread(), true); folder1.setNew(email1.getMessageID(), false); }
public void setNew(String messageId, boolean isNew) throws PasswordException, GeneralSecurityException { EmailMetadata metadata = getMetadata(messageId); metadata.setUnread(isNew); try { saveMetadata(metadata, getMetadataFile(messageId)); } catch (IOException e) { log.error("Can't read metadata file for message ID <" + messageId + ">", e); } }
EmailFolder extends Folder<Email> { public void setNew(String messageId, boolean isNew) throws PasswordException, GeneralSecurityException { EmailMetadata metadata = getMetadata(messageId); metadata.setUnread(isNew); try { saveMetadata(metadata, getMetadataFile(messageId)); } catch (IOException e) { log.error("Can't read metadata file for message ID <" + messageId + ">", e); } } }
EmailFolder extends Folder<Email> { public void setNew(String messageId, boolean isNew) throws PasswordException, GeneralSecurityException { EmailMetadata metadata = getMetadata(messageId); metadata.setUnread(isNew); try { saveMetadata(metadata, getMetadataFile(messageId)); } catch (IOException e) { log.error("Can't read metadata file for message ID <" + messageId + ">", e); } } EmailFolder(File storageDir, PasswordHolder passwordHolder); }
EmailFolder extends Folder<Email> { public void setNew(String messageId, boolean isNew) throws PasswordException, GeneralSecurityException { EmailMetadata metadata = getMetadata(messageId); metadata.setUnread(isNew); try { saveMetadata(metadata, getMetadataFile(messageId)); } catch (IOException e) { log.error("Can't read metadata file for message ID <" + messageId + ">", e); } } EmailFolder(File storageDir, PasswordHolder passwordHolder); void add(Email email); void changePassword(byte[] oldPassword, DerivedKey newKey); List<Email> getElements(AddressDisplayFilter displayFilter, EmailAttribute sortColumn, boolean descending); Email getEmail(String messageId); boolean move(String messageId, EmailFolder newFolder); boolean move(Email email, EmailFolder newFolder); int getNumNewEmails(); Email getLatestUnreadEmail(); void setRecent(String messageId, boolean isRecent); void setNew(String messageId, boolean isNew); void setNew(Email email, boolean isNew); void setReplied(String messageId, boolean replied); void saveMetadata(Email email); boolean delete(String messageId); void addFolderListener(FolderListener folderListener); void removeFolderListener(FolderListener folderListener); }
EmailFolder extends Folder<Email> { public void setNew(String messageId, boolean isNew) throws PasswordException, GeneralSecurityException { EmailMetadata metadata = getMetadata(messageId); metadata.setUnread(isNew); try { saveMetadata(metadata, getMetadataFile(messageId)); } catch (IOException e) { log.error("Can't read metadata file for message ID <" + messageId + ">", e); } } EmailFolder(File storageDir, PasswordHolder passwordHolder); void add(Email email); void changePassword(byte[] oldPassword, DerivedKey newKey); List<Email> getElements(AddressDisplayFilter displayFilter, EmailAttribute sortColumn, boolean descending); Email getEmail(String messageId); boolean move(String messageId, EmailFolder newFolder); boolean move(Email email, EmailFolder newFolder); int getNumNewEmails(); Email getLatestUnreadEmail(); void setRecent(String messageId, boolean isRecent); void setNew(String messageId, boolean isNew); void setNew(Email email, boolean isNew); void setReplied(String messageId, boolean replied); void saveMetadata(Email email); boolean delete(String messageId); void addFolderListener(FolderListener folderListener); void removeFolderListener(FolderListener folderListener);  }