1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-14 21:45:14 -05:00
k-9/src/com/fsck/k9/mail/Transport.java
Jesse Vincent f31b2702a4 Massive rename to K9, step 1.
Conflicts:

	src/com/android/email/Email.java
2009-12-15 02:50:53 +00:00

36 lines
950 B
Java

package com.fsck.k9.mail;
import com.fsck.k9.mail.transport.SmtpTransport;
import com.fsck.k9.mail.transport.WebDavTransport;
public abstract class Transport
{
protected static final int SOCKET_CONNECT_TIMEOUT = 10000;
// RFC 1047
protected static final int SOCKET_READ_TIMEOUT = 300000;
public synchronized static Transport getInstance(String uri) throws MessagingException
{
if (uri.startsWith("smtp"))
{
return new SmtpTransport(uri);
}
else if (uri.startsWith("webdav"))
{
return new WebDavTransport(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;
}