ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@apache.org
Subject cvs commit: ant/docs/manual/OptionalTasks ftp.html
Date Sat, 21 May 2005 13:02:02 GMT
scohen      2005/05/21 06:02:02

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
               docs/manual/OptionalTasks ftp.html
  Log:
  Change so that systemTypeKey and all the new xxxConfig attributes work by the convention
that setting the attribute to "" leaves the attribute unset, at
  whatever value it had before, that is, for all these, the default value of null.  This would
enable property-file based development to proceed more easily.
  Update documentantation to reflect this.
  PR: 34978
  
  Revision  Changes    Path
  1.73      +52 -23    ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- FTP.java	19 May 2005 07:58:54 -0000	1.72
  +++ FTP.java	21 May 2005 13:02:02 -0000	1.73
  @@ -1257,67 +1257,96 @@
       /**
        * Method for setting <code>FTPClientConfig</code> remote system key.
        * 
  -     * @param systemTypeKey
  +     * @param systemTypeKey the key to be set - BUT if blank 
  +     * the default value of null will be kept.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setSystemTypeKey(String systemKey) {
  -        this.systemTypeKey = systemKey;
  -        configurationHasBeenSet();
  +        if (systemKey != null && !systemKey.equals(""))
  +        {
  +            this.systemTypeKey = systemKey;
  +            configurationHasBeenSet();
  +        }
       }
   
       /**
  -     * Delegate method for <code>FTPClientConfig.setDefaultDateFormatStr(String)</code>.
  +     * Delegate method for
  +     * <code>FTPClientConfig.setDefaultDateFormatStr(String)</code>.
        * 
  -     * @param defaultDateFormatConfig
  +     * @param defaultDateFormatConfig configuration to be set, unless it is
  +     * null or empty string, in which case ignored.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setDefaultDateFormatConfig(String defaultDateFormat) {
  -        this.defaultDateFormatConfig = defaultDateFormat;
  -        configurationHasBeenSet();
  +        if (defaultDateFormat != null && !defaultDateFormat.equals(""))
  +        {
  +            this.defaultDateFormatConfig = defaultDateFormat;
  +            configurationHasBeenSet();
  +        }
       }
   
       /**
  -     * Delegate method for <code>FTPClientConfig.setRecentDateFormatStr(String)</code>.
  +     * Delegate method for
  +     * <code>FTPClientConfig.setRecentDateFormatStr(String)</code>.
        * 
  -     * @param recentDateFormatConfig
  +     * @param recentDateFormatConfig configuration to be set, unless it is
  +     * null or empty string, in which case ignored.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setRecentDateFormatConfig(String recentDateFormat) {
  -        this.recentDateFormatConfig = recentDateFormat;
  -        configurationHasBeenSet();
  +        if (recentDateFormat != null && !recentDateFormat.equals(""))
  +        {
  +            this.recentDateFormatConfig = recentDateFormat;
  +            configurationHasBeenSet();
  +        }
       }
   
       /**
  -     * Delegate method for <code>FTPClientConfig.setServerLanguageCode(String)</code>.
  +     * Delegate method for
  +     * <code>FTPClientConfig.setServerLanguageCode(String)</code>.
        * 
  -     * @param serverLanguageCodeConfig
  +     * @param serverLanguageCodeConfig configuration to be set, unless it is
  +     * null or empty string, in which case ignored.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setServerLanguageCodeConfig(String serverLanguageCode) {
  -        this.serverLanguageCodeConfig = serverLanguageCode;
  -        configurationHasBeenSet();
  +        if (serverLanguageCode != null && !serverLanguageCode.equals(""))
  +        {
  +            this.serverLanguageCodeConfig = serverLanguageCode;
  +            configurationHasBeenSet();
  +        }
       }
   
       /**
  -     * Delegate method for <code>FTPClientConfig.setServerTimeZoneId(String)</code>.
  +     * Delegate method for
  +     * <code>FTPClientConfig.setServerTimeZoneId(String)</code>.
        * 
  -     * @param serverTimeZoneConfig
  +     * @param serverTimeZoneConfig configuration to be set, unless it is
  +     * null or empty string, in which case ignored.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setServerTimeZoneConfig(String serverTimeZoneId) {
  -        this.serverTimeZoneConfig = serverTimeZoneId;
  -        configurationHasBeenSet();
  +        if (serverTimeZoneId != null && !serverTimeZoneId.equals(""))
  +        {
  +            this.serverTimeZoneConfig = serverTimeZoneId;
  +            configurationHasBeenSet();
  +        }
       }
   
       /**
  -     * Delegate method for <code>FTPClientConfig.setShortMonthNames(String)</code>.
  +     * Delegate method for
  +     * <code>FTPClientConfig.setShortMonthNames(String)</code>.
        * 
  -     * @param shortMonthNamesConfig
  +     * @param shortMonthNamesConfig configuration to be set, unless it is
  +     * null or empty string, in which case ignored.
        * @see org.apache.commons.net.ftp.FTPClientConfig
        */
       public void setShortMonthNamesConfig(String shortMonthNames) {
  -        this.shortMonthNamesConfig = shortMonthNames;
  -        configurationHasBeenSet();
  +        if (shortMonthNames != null && !shortMonthNames.equals(""))
  +        {
  +            this.shortMonthNamesConfig = shortMonthNames;
  +            configurationHasBeenSet();
  +        }
       }
   
   
  
  
  
  1.35      +28 -12    ant/docs/manual/OptionalTasks/ftp.html
  
  Index: ftp.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/ftp.html,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- ftp.html	17 May 2005 23:33:51 -0000	1.34
  +++ ftp.html	21 May 2005 13:02:02 -0000	1.35
  @@ -187,18 +187,33 @@
       </p><p>
       If none of these is specified, the default mechanism of letting the system
       auto-detect the server OS type based on the FTP SYST command and assuming
  -    standard formatting for that OS type will be used.</p>
  -    </td>
  +    standard formatting for that OS type will be used.
  +    </p><p>
  +    To aid in property-file-based development where a build script is configured
  +    with property files, for any of these attributes, a value of <code>""</code>
  +    is equivalent to not specifying it.
  +    </p><p>
  +    Please understand that these options are incompatible with the autodetection
  +    scheme.  If any of these options is specified, (other than with a value of
  +    <code>""</code> ) a system type must be chosen and if systemTypeKey is
not
  +    specified, UNIX will be assumed. The philosophy behind this is that these
  +    options are for setting non-standard formats, and a build-script author who
  +    knows what system he is dealing with will know what options to need to be
  +    set. Otherwise, these options should be left alone and the default
  +    autodetection scheme can be used and will work in the majority of cases.
  +    </p></td>
       </tr>
     <tr>
       <td valign="top">systemTypeKey</td>
       <td valign="top">Specifies the type of system in use on the server.
  -      Supported values are "UNIX", "VMS", "WINDOWS", "OS/2", "OS/400", "MVS".
  -      If not specified, and no other xxxConfig attributes are specified, the
  -      autodectection mechanism based on the FTP SYST command will be used.
  +      Supported values are <code>"UNIX", "VMS", "WINDOWS", "OS/2", "OS/400",
  +      "MVS".</code>  If not specified, (or specified as <code>""</code>)
and if
  +      no other xxxConfig attributes are specified, the autodectection mechanism
  +      based on the FTP SYST command will be used.
       </td>
       <td valign="top" align="center">No, but if any of the following xxxConfig
  -        attributes is specified, UNIX will be assumed.
  +        attributes is specified, UNIX will be assumed, even if <code>""</code>
  +        is specified here.
       </td>
      </tr>
      <tr>
  @@ -208,7 +223,8 @@
       <code>Asia/Jakarta</code>) the timezone
         used by the server for timestamps.  This enables Ant timestamp dependency
         checking even when the server is in a different timezone than the client.
  -      If not specified, the timezone of the client is assumed.
  +      If not specified, (or specified as <code>""</code>), the timezone of
the
  +      client is assumed.
       </td>
       <td valign="top" align="center">No</td>
     </tr>
  @@ -219,8 +235,8 @@
         to parse dates.  In some cases this will be the only date format used.
         In others, (unix for example) this will be used for dates
         older than a year old. (See recentDateFormatConfig).  If not specified,
  -      the default date format for the system type indicated by the
  -      systemTypeKey attribute will be used.
  +      (or specified as <code>""</code>), the default date format for the system
  +      type indicated by the systemTypeKey attribute will be used.
       </td>
       <td valign="top" align="center">
       No.
  @@ -230,9 +246,9 @@
       <td valign="top">recentDateFormatConfig</td>
       <td valign="top">Specify in java.text.SimpleDateFormat notation,
         (e.g. <code>MMM dd hh:mm</code>) the date format used by the FTP server
  -      to parse dates less than a year old.  If not specified, and if the system
  -      type indicated by the system key uses a recent date format, its standard
  -      format will be used.
  +      to parse dates less than a year old.  If not specified (or specified as
  +      <code>""</code>), and if the system type indicated by the system key
uses
  +      a recent date format, its standard format will be used.
       </td>
       <td valign="top" align="center">No</td>
     </tr>
  
  
  

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


Mime
View raw message