home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Mail For Me / Mail4ME.jar / de / trantor / mail / Connection.class (.txt) next >
Encoding:
Java Class File  |  2001-10-21  |  1.4 KB  |  28 lines

  1. package de.trantor.mail;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.OutputStream;
  6.  
  7. public abstract class Connection {
  8.    public abstract void open(String var1, int var2) throws IOException;
  9.  
  10.    public abstract void close() throws IOException;
  11.  
  12.    public abstract InputStream getInputStream() throws IOException;
  13.  
  14.    public abstract OutputStream getOutputStream() throws IOException;
  15.  
  16.    public static Connection createConnection() throws Exception {
  17.       String classname;
  18.       if (System.getProperty("microedition.configuration") != null) {
  19.          classname = "de.trantor.mail.j2me.ConnectionImpl";
  20.       } else {
  21.          classname = "de.trantor.mail.j2se.ConnectionImpl";
  22.       }
  23.  
  24.       System.out.println("[INFO] Using \"" + classname + "\" for connections");
  25.       return (Connection)Class.forName(classname).newInstance();
  26.    }
  27. }
  28.