/** @see EmailMetadata#isUnread() */ public boolean isUnread() { return metadata.isUnread(); }
/** * Returns the number of <strong>new</strong> emails in the folder. * @throws PasswordException * @see i2p.bote.folder.Folder#getNumElements() */ public int getNumNewEmails() throws PasswordException { int numNew = 0; for (File emailFile: getFilenames()) { // getFilenames() only returns email files but not metadata files File metaFile = getMetadataFile(emailFile); if (metaFile.exists()) try { EmailMetadata metadata = getMetadata(metaFile); if (metadata.isUnread()) numNew++; } catch (IOException e) { log.error("Can't read metadata file: <" + metaFile.getAbsolutePath() + ">", e); } catch (GeneralSecurityException gse) { log.error("Can't access metadata file: <" + metaFile.getAbsolutePath() + ">", gse); } else numNew++; } return numNew; }