mirror of https://github.com/moparisthebest/k-9
23 lines
685 B
Java
23 lines
685 B
Java
|
|
package com.fsck.k9.mail;
|
|
|
|
import com.fsck.k9.mail.transport.SmtpTransport;
|
|
|
|
public abstract class Transport {
|
|
protected static final int SOCKET_CONNECT_TIMEOUT = 10000;
|
|
|
|
public synchronized static Transport getInstance(String uri) throws MessagingException {
|
|
if (uri.startsWith("smtp")) {
|
|
return new SmtpTransport(uri);
|
|
} else {
|
|
throw new MessagingException("Unable to locate an applicable Transport for " + uri);
|
|
}
|
|
}
|
|
|
|
public abstract void open() throws MessagingException;
|
|
|
|
public abstract void sendMessage(Message message) throws MessagingException;
|
|
|
|
public abstract void close() throws MessagingException;
|
|
}
|