package org.ibex.mail.target;
+import org.ibex.mail.*;
import org.ibex.util.*;
import org.ibex.mail.*;
import java.io.*;
private static final String STORAGE_ROOT =
System.getProperty("ibex.mail.root", File.separatorChar + "var" + File.separatorChar + "org.ibex.mail");
-
- //public final FileBased root = new FileBased(STORAGE_ROOT + File.separatorChar);
+ public static FileBased root = null;
public static Transcript transcript = null;
static {
try {
+ root = new FileBased(STORAGE_ROOT + File.separatorChar);
transcript = new Transcript(STORAGE_ROOT + File.separatorChar + "transcript");
} catch (Exception e) {
e.printStackTrace();
public int[] list() { throw new Error(this.getClass().getName() + " does not support the list() method"); }
public int add(Message message) throws IOException {
throw new Error(this.getClass().getName() + " does not support the add() method"); }
- public Message.StoredMessage get(int messagenum) throws IOException {
+ public int delete(Message message) throws IOException {
+ throw new Error(this.getClass().getName() + " does not support the delete() method"); }
+ public Message get(int messagenum) throws IOException {
throw new Error(this.getClass().getName() + " does not support the get() method"); }
- public Message.StoredMessage[] query(int maxResults) {
+ public Message[] query(int maxResults) {
throw new Error(this.getClass().getName() + " does not support the query() method"); }
/** a fast-write, slow-read place to stash all messages we touch -- in case of a major f*ckup */
return target;
}
- public Message.StoredMessage get(int messagenum) throws IOException {
+ public Message get(int messagenum) throws IOException {
File f = new File(path + File.separatorChar + messagenum + ".");
if (!f.exists()) throw new FileNotFoundException(f.toString());
- try {
- Message.StoredMessage ret =
- new Message.StoredMessage(new LineReader(new InputStreamReader(new FileInputStream(f))));
+ //try {
+ // FIXME: need to store envelope from/to
+ //Message ret = new Message(new LineReader(new InputStreamReader(new FileInputStream(f))));
// FIXME: set answered/read/etc here
- return ret;
+ //return ret;
+ return null;
+ /*
} catch (MailException.Malformed malf) {
Log.error(this, "This should never happen");
Log.error(this, malf);
return null;
}
+ */
}
// query types: stringmatch (headers, body), header element, deletion status, date range, message size
- public Message.StoredMessage[] query(int maxResults) {
+ public Message[] query(int maxResults) {
throw new RuntimeException("FileBased.query() not implemented yet");
}