antoine     2003/07/29 04:19:28

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
  Log:
  Some ftp servers have binary as default, so when binary is false
  it is good to set explicitly the ascii mode for the transfer.
  Problem reported by Michael Nebus (Michael dot Nebus at Pfizer dot com)
  
  Revision  Changes    Path
  1.39      +6 -0      
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.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- FTP.java  26 Jul 2003 15:58:11 -0000      1.38
  +++ FTP.java  29 Jul 2003 11:19:27 -0000      1.39
  @@ -1203,6 +1203,12 @@
                       throw new BuildException("could not set transfer type: "
                           + ftp.getReplyString());
                   }
  +            } else {
  +                
ftp.setFileType(org.apache.commons.net.ftp.FTP.ASCII_FILE_TYPE);
  +                if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
  +                    throw new BuildException("could not set transfer type: "
  +                        + ftp.getReplyString());
  +                }
               }
   
               if (passive) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to