ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeme Praks <>
Subject Re: [patch] - adding support for new features in commons-net 1.4.0 and performance improvement
Date Wed, 11 May 2005 10:26:37 GMT

Steve Loughran wrote:
> I worry about releasing any change to code without giving it time to 
> stabilise and beta test. Last minute "this won't break anything" patches 
> always break something. Always. At least in my experience.
> If commons1.4.0 is incompatible with shipping <ftp> then yes, we have no 
> choice but to upgrade. But if it is a feature enhancement, then it needs
> to go into CVS_HEAD

Very legitimate concern.
However, this is a trivial change.
commons-net 1.4.0 added a configuration javabean for FTP client.
It is a simple value-object that has some setters and then it can be 
used to configure a FTP client instance.

All the added code does is expose this javabean on the FTP task through 
delegating setters.

Let me illustrate with some code:

public class FTP extends Task {
     private FTPClientConfig configuration = null;

      * Gets a FTPClientConfig. If the configuration object has not been
      * created yet, it is created also.
     private FTPClientConfig getConfiguration() {
         if (this.configuration == null) {
             this.configuration = new FTPClientConfig();
         return this.configuration;

      * Delegate method for 
      * @param defaultDateFormatStr
      * @see #getConfiguration()
      * @see FTPClientConfig
     public void setDefaultDateFormat(String defaultDateFormatStr) {

[...there are 5 more delegating setters like this, but I'm skipping them 
here for clarity...]

     public void execute() throws BuildException {
         ftp = new FTPClient();
         if (this.configuration != null) {
         ftp.connect(server, port);


Simple enough, no?
Assuming that commons-net code is bug-free, this code cannot possibly 
break anything. And it is backwards compatible, if there is no 
configuration set, no configuration is used.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message