home *** CD-ROM | disk | FTP | other *** search
- package de.trantor.mail;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
-
- public abstract class Connection {
- public abstract void open(String var1, int var2) throws IOException;
-
- public abstract void close() throws IOException;
-
- public abstract InputStream getInputStream() throws IOException;
-
- public abstract OutputStream getOutputStream() throws IOException;
-
- public static Connection createConnection() throws Exception {
- String classname;
- if (System.getProperty("microedition.configuration") != null) {
- classname = "de.trantor.mail.j2me.ConnectionImpl";
- } else {
- classname = "de.trantor.mail.j2se.ConnectionImpl";
- }
-
- System.out.println("[INFO] Using \"" + classname + "\" for connections");
- return (Connection)Class.forName(classname).newInstance();
- }
- }
-