ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net RExecTask.java SetProxy.java TelnetTask.java
Date Fri, 11 Mar 2005 15:27:41 GMT
peterreilly    2005/03/11 07:27:41

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/net
                        RExecTask.java SetProxy.java TelnetTask.java
  Log:
  stylecheck - mostly javadoc
  
  Revision  Changes    Path
  1.11      +54 -8     ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
  
  Index: RExecTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- RExecTask.java	18 Feb 2005 11:00:58 -0000	1.10
  +++ RExecTask.java	11 Mar 2005 15:27:40 -0000	1.11
  @@ -83,6 +83,12 @@
        */
       public class RExecSubTask {
           protected String taskString = "";
  +
  +        /**
  +         * Execute the subtask.
  +         * @param rexec the client
  +         * @throws BuildException always as it is not allowed to instantiate this object
  +         */
           public void execute(AntRExecClient rexec)
                   throws BuildException {
               throw new BuildException("Shouldn't be able instantiate a SubTask directly");
  @@ -90,6 +96,7 @@
   
           /**
            *  the message as nested text
  +         * @param s the nested text
            */
           public void addText(String s) {
               setString(getProject().replaceProperties(s));
  @@ -97,6 +104,7 @@
   
           /**
            * the message as an attribute
  +         * @param s a <code>String</code> value
            */
           public void setString(String s) {
              taskString += s;
  @@ -108,6 +116,11 @@
        */
       public class RExecWrite extends RExecSubTask {
           private boolean echoString = true;
  +        /**
  +         * Execute the write exec task.
  +         * @param rexec the task to use
  +         * @throws BuildException on error
  +         */
           public void execute(AntRExecClient rexec)
                  throws BuildException {
              rexec.sendString(taskString, echoString);
  @@ -116,6 +129,7 @@
           /**
            * Whether or not the message should be echoed to the log.
            * Defaults to <code>true</code>.
  +         * @param b a <code>boolean</code> value
            */
           public void setEcho(boolean b) {
              echoString = b;
  @@ -128,12 +142,18 @@
        */
       public class RExecRead extends RExecSubTask {
           private Integer timeout = null;
  +        /**
  +         * Execute the read exec task.
  +         * @param rexec the task to use
  +         * @throws BuildException on error
  +         */
           public void execute(AntRExecClient rexec)
                  throws BuildException {
               rexec.waitForString(taskString, timeout);
           }
           /**
            *  a timeout value that overrides any task wide timeout.
  +         * @param i an <code>Integer</code> value
            */
           public void setTimeout(Integer i) {
              this.timeout = i;
  @@ -141,6 +161,7 @@
   
           /**
            * Sets the default timeout if none has been set already
  +         * @param defaultTimeout an <code>Integer</code> value
            * @ant.attribute ignore="true"
            */
           public void setDefaultTimeout(Integer defaultTimeout) {
  @@ -206,7 +227,8 @@
   
           /**
            * Write this string to the rexec session.
  -         * @param echoString  Logs string sent
  +         * @param s          the string to write
  +         * @param echoString if true log the string sent
            */
           public void sendString(String s, boolean echoString) {
               OutputStream os = this.getOutputStream();
  @@ -279,6 +301,7 @@
        *  A string to wait for from the server.
        *  A subTask &lt;read&gt; tag was found.  Create the object,
        *  Save it in our list, and return it.
  +     * @return a read sub task
        */
   
       public RExecSubTask createRead() {
  @@ -290,6 +313,7 @@
        *  Add text to send to the server
        *  A subTask &lt;write&gt; tag was found.  Create the object,
        *  Save it in our list, and return it.
  +     * @return a write sub task
        */
       public RExecSubTask createWrite() {
           RExecSubTask task = (RExecSubTask) new RExecWrite();
  @@ -298,8 +322,9 @@
       }
       /**
        *  Verify that all parameters are included.
  -     *  Connect and possibly login
  -     *  Iterate through the list of Reads and writes
  +     *  Connect and possibly login.
  +     *  Iterate through the list of Reads and writes.
  +     * @throws BuildException on error
        */
       public void execute() throws BuildException {
           /**  A server name is required to continue */
  @@ -367,10 +392,15 @@
       }
       /**
        * Set the the comand to execute on the server;
  +     * @param c a <code>String</code> value
        */
  -    public void setCommand(String c) { this.command = c; }
  +    public void setCommand(String c) {
  +        this.command = c;
  +    }
  +
       /**
        *  send a carriage return after connecting; optional, defaults to false.
  +     * @param b a <code>boolean</code> value
        */
       public void setInitialCR(boolean b) {
           this.addCarriageReturn = b;
  @@ -378,19 +408,32 @@
       /**
        *  Set the the login password to use
        * required if <tt>userid</tt> is set.
  +     * @param p a <code>String</code> value
        */
  -    public void setPassword(String p) { this.password = p; }
  +    public void setPassword(String p) {
  +        this.password = p;
  +    }
  +
       /**
        *  Set the tcp port to connect to; default is 23.
  +     * @param p an <code>int</code> value
        */
  -    public void setPort(int p) { this.port = p; }
  +    public void setPort(int p) {
  +        this.port = p;
  +    }
  +
       /**
        *  Set the hostname or address of the remote server.
  +     * @param m a <code>String</code> value
        */
  -    public void setServer(String m) { this.server = m; }
  +    public void setServer(String m) {
  +        this.server = m;
  +    }
  +
       /**
        * set a default timeout in seconds to wait for a response,
        * zero means forever (the default)
  +     * @param i an <code>Integer</code> value
        */
       public void setTimeout(Integer i) {
           this.defaultTimeout = i;
  @@ -398,6 +441,9 @@
       /**
        * Set the the login id to use on the server;
        * required if <tt>password</tt> is set.
  +     * @param u a <code>String</code> value
        */
  -    public void setUserid(String u) { this.userid = u; }
  +    public void setUserid(String u) {
  +        this.userid = u;
  +    }
   }
  
  
  
  1.25      +1 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java
  
  Index: SetProxy.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SetProxy.java	21 Dec 2004 14:08:20 -0000	1.24
  +++ SetProxy.java	11 Mar 2005 15:27:40 -0000	1.25
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -16,15 +16,12 @@
    */
   package org.apache.tools.ant.taskdefs.optional.net;
   
  -import java.lang.reflect.InvocationTargetException;
  -import java.lang.reflect.Method;
   import java.net.Authenticator;
   import java.net.PasswordAuthentication;
   import java.util.Properties;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
   /**
    * Sets Java's web proxy properties, so that tasks and code run in
  
  
  
  1.32      +45 -7     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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TelnetTask.java	9 Mar 2005 00:20:41 -0000	1.31
  +++ TelnetTask.java	11 Mar 2005 15:27:40 -0000	1.32
  @@ -74,6 +74,7 @@
        *  Verify that all parameters are included.
        *  Connect and possibly login
        *  Iterate through the list of Reads and writes
  +     * @throws BuildException on error
        */
       public void execute() throws BuildException {
          /**  A server name is required to continue */
  @@ -141,27 +142,40 @@
       /**
        * Set the the login id to use on the server;
        * required if <tt>password</tt> is set.
  +     * @param u a <code>String</code> value
        */
  -    public void setUserid(String u) { this.userid = u; }
  +    public void setUserid(String u) {
  +        this.userid = u;
  +    }
   
       /**
        *  Set the the login password to use
        * required if <tt>userid</tt> is set.
  +     * @param p a <code>String</code> value
        */
  -    public void setPassword(String p) { this.password = p; }
  +    public void setPassword(String p) {
  +        this.password = p;
  +    }
   
       /**
        *  Set the hostname or address of the remote server.
  +     * @param m a <code>String</code> value
        */
  -    public void setServer(String m) { this.server = m; }
  +    public void setServer(String m) {
  +        this.server = m;
  +    }
   
       /**
        *  Set the tcp port to connect to; default is 23.
  +     * @param p an <code>int</code> value
        */
  -    public void setPort(int p) { this.port = p; }
  +    public void setPort(int p) {
  +        this.port = p;
  +    }
   
       /**
        *  send a carriage return after connecting; optional, defaults to false.
  +     * @param b a <code>boolean</code> value
        */
       public void setInitialCR(boolean b) {
          this.addCarriageReturn = b;
  @@ -170,6 +184,7 @@
       /**
        * set a default timeout in seconds to wait for a response,
        * zero means forever (the default)
  +     * @param i an <code>Integer</code> value
        */
       public void setTimeout(Integer i) {
          this.defaultTimeout = i;
  @@ -179,6 +194,7 @@
        *  A string to wait for from the server.
        *  A subTask &lt;read&gt; tag was found.  Create the object,
        *  Save it in our list, and return it.
  +     * @return a read telnet sub task
        */
   
       public TelnetSubTask createRead() {
  @@ -191,6 +207,7 @@
        *  Add text to send to the server
        *  A subTask &lt;write&gt; tag was found.  Create the object,
        *  Save it in our list, and return it.
  +     * @return a write telnet sub task
        */
       public TelnetSubTask createWrite() {
           TelnetSubTask task = (TelnetSubTask) new TelnetWrite();
  @@ -204,6 +221,11 @@
        */
       public class TelnetSubTask {
           protected String taskString = "";
  +        /**
  +         * Execute the subtask.
  +         * @param telnet the client
  +         * @throws BuildException always as it is not allowed to instantiate this object
  +         */
           public void execute(AntTelnetClient telnet)
                   throws BuildException {
               throw new BuildException("Shouldn't be able instantiate a SubTask directly");
  @@ -211,6 +233,7 @@
   
           /**
            *  the message as nested text
  +         * @param s the nested text
            */
           public void addText(String s) {
               setString(getProject().replaceProperties(s));
  @@ -218,6 +241,7 @@
   
           /**
            * the message as an attribute
  +         * @param s a <code>String</code> value
            */
           public void setString(String s) {
              taskString += s;
  @@ -229,6 +253,11 @@
        */
       public class TelnetWrite extends TelnetSubTask {
           private boolean echoString = true;
  +        /**
  +         * Execute the write task.
  +         * @param telnet the task to use
  +         * @throws BuildException on error
  +         */
           public void execute(AntTelnetClient telnet)
                  throws BuildException {
              telnet.sendString(taskString, echoString);
  @@ -237,6 +266,7 @@
           /**
            * Whether or not the message should be echoed to the log.
            * Defaults to <code>true</code>.
  +         * @param b a <code>boolean</code> value
            */
           public void setEcho(boolean b) {
              echoString = b;
  @@ -249,12 +279,18 @@
        */
       public class TelnetRead extends TelnetSubTask {
           private Integer timeout = null;
  +        /**
  +         * Execute the read task.
  +         * @param telnet the task to use
  +         * @throws BuildException on error
  +         */
           public void execute(AntTelnetClient telnet)
                  throws BuildException {
               telnet.waitForString(taskString, timeout);
           }
           /**
            *  a timeout value that overrides any task wide timeout.
  +         * @param i an <code>Integer</code> value
            */
           public void setTimeout(Integer i) {
              this.timeout = i;
  @@ -262,6 +298,7 @@
   
           /**
            * Sets the default timeout if none has been set already
  +         * @param defaultTimeout an <code>Integer</code> value
            * @ant.attribute ignore="true"
            */
           public void setDefaultTimeout(Integer defaultTimeout) {
  @@ -328,9 +365,10 @@
           }
   
           /**
  -        * Write this string to the telnet session.
  -        * @param echoString  Logs string sent
  -        */
  +         * Write this string to the telnet session.
  +         * @param s          the string to write
  +         * @param echoString if true log the string sent
  +         */
           public void sendString(String s, boolean echoString) {
               OutputStream os = this.getOutputStream();
               try {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message