2008-11-01 17:32:06 -04:00
|
|
|
|
2009-12-14 21:50:53 -05:00
|
|
|
package com.fsck.k9.mail;
|
2008-11-01 17:32:06 -04:00
|
|
|
|
2014-12-14 10:54:27 -05:00
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
import java.net.URLDecoder;
|
|
|
|
import java.net.URLEncoder;
|
2012-03-05 15:04:34 -05:00
|
|
|
import java.util.List;
|
2009-12-09 22:16:42 -05:00
|
|
|
|
2008-11-01 17:32:06 -04:00
|
|
|
/**
|
|
|
|
* Store is the access point for an email message store. It's location can be
|
|
|
|
* local or remote and no specific protocol is defined. Store is intended to
|
|
|
|
* loosely model in combination the JavaMail classes javax.mail.Store and
|
|
|
|
* javax.mail.Folder along with some additional functionality to improve
|
|
|
|
* performance on mobile devices. Implementations of this class should focus on
|
|
|
|
* making as few network connections as possible.
|
|
|
|
*/
|
2011-02-06 17:09:48 -05:00
|
|
|
public abstract class Store {
|
2010-11-30 22:02:13 -05:00
|
|
|
public abstract Folder getFolder(String name);
|
2008-11-01 17:32:06 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public abstract List <? extends Folder > getPersonalNamespaces(boolean forceListAll) throws MessagingException;
|
2008-11-01 17:32:06 -04:00
|
|
|
|
|
|
|
public abstract void checkSettings() throws MessagingException;
|
2009-11-24 19:40:29 -05:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean isCopyCapable() {
|
2009-11-24 19:40:29 -05:00
|
|
|
return false;
|
2009-03-05 02:32:45 -05:00
|
|
|
}
|
2011-06-06 15:10:14 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean isMoveCapable() {
|
2009-11-24 19:40:29 -05:00
|
|
|
return false;
|
2009-03-05 02:32:45 -05:00
|
|
|
}
|
2011-06-06 15:10:14 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean isPushCapable() {
|
2009-10-21 20:41:06 -04:00
|
|
|
return false;
|
|
|
|
}
|
2011-06-06 15:10:14 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean isSendCapable() {
|
2009-10-24 22:58:26 -04:00
|
|
|
return false;
|
|
|
|
}
|
2011-06-06 15:10:14 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public boolean isExpungeCapable() {
|
Implementation of complete IMAP two-phase "delete/expunge" behavior.
On each IMAP account, the expunge behavior can be set to expunge
messages in a folder as soon as a move or delete is performed on the
folder ("immediately"), each time the folder is polled, or only when
executed manually.
In the Message List, there is now an Expunge action in the option
menu.
In the Folder List, there is now an Expunge action in the context
menu (long-press on the folder).
For IMAP accounts, it is also possible to disable the copying of deleted messages to the
Trash folder, by setting the Trash folder to -NONE-.
Fixes Issue 536.
Separately, in WebDAV accounts, the user can now choose the
server-side equivalents of the special folders, just like for IMAP.
2009-12-20 18:13:49 -05:00
|
|
|
return false;
|
|
|
|
}
|
2010-01-02 20:50:51 -05:00
|
|
|
|
2013-03-13 01:34:14 -04:00
|
|
|
public boolean isSeenFlagSupported() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-12-11 22:23:32 -05:00
|
|
|
public void sendMessages(List<? extends Message> messages) throws MessagingException { }
|
2009-10-21 20:41:06 -04:00
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public Pusher getPusher(PushReceiver receiver) {
|
2009-10-21 20:41:06 -04:00
|
|
|
return null;
|
|
|
|
}
|
2014-12-14 10:54:27 -05:00
|
|
|
|
|
|
|
protected static String decodeUtf8(String s) {
|
|
|
|
try {
|
|
|
|
return URLDecoder.decode(s, "UTF-8");
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
throw new RuntimeException("UTF-8 not found");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected static String encodeUtf8(String s) {
|
|
|
|
try {
|
|
|
|
return URLEncoder.encode(s, "UTF-8");
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
throw new RuntimeException("UTF-8 not found");
|
|
|
|
}
|
|
|
|
}
|
2008-11-01 17:32:06 -04:00
|
|
|
}
|