public void init(final Prevayler prevayler) throws IOException {
dir.mkdirs();
+ long time = System.currentTimeMillis();
Log.info(this, "initializing maildir " + dir.getParent());
// Drop entries whose files have vanished
}
// Take a snapshot for posterity
- Log.info(this, " done initializing maildir " + dir.getParent());
+ if (System.currentTimeMillis() - time > 1000 * 5)
+ Log.info(this, " done initializing maildir " + dir.getParent());
new Thread() { public void run() {
try { prevayler.takeSnapshot(); } catch (Exception e) { Log.error(this, e); } } }.start();
}
public static Transaction create(File f) throws IOException {
final boolean seen = f.lastModified() == MAGIC_DATE;
- Log.error(Entry.class, "create with seen = " + seen);
final String name = f.getName();
final byte[] header = new MIME.Headers(new Stream(new FileInputStream(f)), true).toString().getBytes();
return new Transaction() {
public int uidNext() { return cache.uidNext(); }
public synchronized void add(Message message, int flags) {
- Log.info(path, message.summary());
try {
String name, fullname; File target, f;
for(int i = cache.uidNext(); ; i++) {
if ((flags & Mailbox.Flag.SEEN) == Mailbox.Flag.SEEN) f.setLastModified(MAGIC_DATE);
prevayler.execute(Cache.Entry.create(f));
} catch (IOException e) { throw new MailException.IOException(e); }
+ Log.info(this, path + " <= " + message.summary());
}
private class Iterator extends Mailbox.Default.Iterator {