--- projects/cms/source/util/uk/org/iscream/cms/util/Smtp.java 2001/02/05 22:21:38 1.4 +++ projects/cms/source/util/uk/org/iscream/cms/util/Smtp.java 2002/02/07 17:57:06 1.7 @@ -1,5 +1,5 @@ //---PACKAGE DECLARATION--- -package uk.ac.ukc.iscream.util; +package uk.org.iscream.cms.server.util; //---IMPORTS--- import java.net.*; @@ -10,7 +10,7 @@ import java.io.*; * for the GJT, and scaled to do just what we require. * * @author $Author: tdb $ - * @version $Id: Smtp.java,v 1.4 2001/02/05 22:21:38 tdb Exp $ + * @version $Id: Smtp.java,v 1.7 2002/02/07 17:57:06 tdb Exp $ */ public class Smtp { @@ -19,7 +19,7 @@ public class Smtp { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.4 $"; + public static final String REVISION = "$Revision: 1.7 $"; //---STATIC METHODS--- @@ -116,7 +116,10 @@ public class Smtp { public void sendCommand(String cmd, int reply) throws IOException { _socketOut.println(cmd); String temp = _socketIn.readLine(); - if (!temp.startsWith(new Integer(reply).toString())) { + if (temp == null) { + throw new IOException ("IO error reading from socket, connection to server died?"); + } + if (!temp.startsWith(String.valueOf(reply))) { throw new IOException ("Expected " + reply + ", got " + temp); } } @@ -125,7 +128,7 @@ public class Smtp { * Overrides the {@link java.lang.Object#toString() Object.toString()} * method to provide clean logging (every class should have this). * - * This uses the uk.ac.ukc.iscream.util.FormatName class + * This uses the uk.org.iscream.cms.server.util.FormatName class * to format the toString() * * @return the name of this class and its CVS revision