bodewig 2004/06/23 05:19:23
Modified: src/main/org/apache/tools/ant/taskdefs/optional/net
TelnetTask.java
Log:
Small refactoring to prepare for bug 25935
Revision Changes Path
1.26 +4 -9
ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Index: TelnetTask.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- TelnetTask.java 9 Mar 2004 16:48:32 -0000 1.25
+++ TelnetTask.java 23 Jun 2004 12:19:23 -0000 1.26
@@ -56,11 +56,6 @@
private int port = 23;
/**
- * The Object which handles the telnet session.
- */
- private AntTelnetClient telnet = null;
-
- /**
* The list of read/write commands for this session
*/
private Vector telnetTasks = new Vector();
@@ -97,7 +92,7 @@
}
/** Create the telnet client object */
- telnet = new AntTelnetClient();
+ AntTelnetClient telnet = new AntTelnetClient();
try {
telnet.connect(server, port);
} catch (IOException e) {
@@ -105,7 +100,7 @@
}
/** Login if userid and password were specified */
if (userid != null && password != null) {
- login();
+ login(telnet);
}
/** Process each sub command */
Enumeration tasksToRun = telnetTasks.elements();
@@ -122,7 +117,7 @@
* Process a 'typical' login. If it differs, use the read
* and write tasks explicitely
*/
- private void login() {
+ private void login(AntTelnetClient telnet) {
if (addCarriageReturn) {
telnet.sendString("\n", true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]