1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.util; |
2 |
> |
package uk.org.iscream.cms.server.util; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
|
import java.net.*; |
116 |
|
public void sendCommand(String cmd, int reply) throws IOException { |
117 |
|
_socketOut.println(cmd); |
118 |
|
String temp = _socketIn.readLine(); |
119 |
< |
if (!temp.startsWith(new Integer(reply).toString())) { |
119 |
> |
if (temp == null) { |
120 |
> |
throw new IOException ("IO error reading from socket, connection to server died?"); |
121 |
> |
} |
122 |
> |
if (!temp.startsWith(String.valueOf(reply))) { |
123 |
|
throw new IOException ("Expected " + reply + ", got " + temp); |
124 |
|
} |
125 |
|
} |
128 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
129 |
|
* method to provide clean logging (every class should have this). |
130 |
|
* |
131 |
< |
* This uses the uk.ac.ukc.iscream.util.FormatName class |
131 |
> |
* This uses the uk.org.iscream.cms.server.util.FormatName class |
132 |
|
* to format the toString() |
133 |
|
* |
134 |
|
* @return the name of this class and its CVS revision |