Browse Source

Indentation of telnet tasks, record bug fix

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276611 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
befcdc7206
2 changed files with 19 additions and 17 deletions
  1. +2
    -0
      WHATSNEW
  2. +17
    -17
      src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java

+ 2
- 0
WHATSNEW View File

@@ -151,6 +151,8 @@ Fixed bugs:
* <scp> now has (local|remote)tofile attributes to rename files on the
fly. Bugzilla Report 26758.

* <telnet> didn't close the session. Bugzilla Report 25935.

Other changes:
--------------
* doc fix concerning the dependencies of the ftp task


+ 17
- 17
src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java View File

@@ -95,24 +95,24 @@ public class TelnetTask extends Task {
AntTelnetClient telnet = null;
try {
telnet = new AntTelnetClient();
try {
telnet.connect(server, port);
} catch (IOException e) {
throw new BuildException("Can't connect to " + server);
}
/** Login if userid and password were specified */
if (userid != null && password != null) {
login(telnet);
}
/** Process each sub command */
Enumeration tasksToRun = telnetTasks.elements();
while (tasksToRun != null && tasksToRun.hasMoreElements()) {
TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();
if (task instanceof TelnetRead && defaultTimeout != null) {
((TelnetRead) task).setDefaultTimeout(defaultTimeout);
try {
telnet.connect(server, port);
} catch (IOException e) {
throw new BuildException("Can't connect to " + server);
}
/** Login if userid and password were specified */
if (userid != null && password != null) {
login(telnet);
}
/** Process each sub command */
Enumeration tasksToRun = telnetTasks.elements();
while (tasksToRun != null && tasksToRun.hasMoreElements()) {
TelnetSubTask task = (TelnetSubTask) tasksToRun.nextElement();
if (task instanceof TelnetRead && defaultTimeout != null) {
((TelnetRead) task).setDefaultTimeout(defaultTimeout);
}
task.execute(telnet);
}
task.execute(telnet);
}
} finally {
if (telnet != null) {
try {


Loading…
Cancel
Save