- public void seen(boolean seen) { }
- public Headers head() {
- if (done()) return null;
- FileInputStream fis = null;
- try {
- return new Headers.Original(new Stream(new FileInputStream(file())));
- } catch (IOException e) { throw new MailException.IOException(e);
- } finally { if (fis != null) try { fis.close(); } catch (Exception e) { /* DELIBERATE */ } }
- }
- public Message cur() {
- FileInputStream fis = null;
- try {
- return Message.newMessage(new Fountain.File(file()));
- //} catch (IOException e) { throw new MailException.IOException(e);
- } catch (Message.Malformed e) { throw new MailException(e.getMessage());
- } finally { if (fis != null) try { fis.close(); } catch (Exception e) { /* DELIBERATE */ } }
+ public int getFlags() { return file().lastModified()==MAGIC_DATE ? 0 : Flag.SEEN; }
+ public void setFlags(int flags) {
+ File f = file();
+ if ((flags & Mailbox.Flag.SEEN) == 0) f.setLastModified(MAGIC_DATE);
+ else if (f.lastModified()==MAGIC_DATE) f.setLastModified(System.currentTimeMillis());
+ // FIXME: other flags?