Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 31642 invoked from network); 10 Jan 2001 16:40:09 -0000 Received: from finch-post-11.mail.demon.net (194.217.242.39) by h31.sny.collab.net with SMTP; 10 Jan 2001 16:40:09 -0000 Received: from [62.49.241.195] (helo=adolospowerbook) by finch-post-11.mail.demon.net with smtp (Exim 2.12 #1) id 14GOIC-000Gqq-0B for ant-dev@jakarta.apache.org; Wed, 10 Jan 2001 16:40:08 +0000 Date: Wed, 10 Jan 2001 16:40:07 +0000 Reply-To: stuart.roebuck@adolos.co.uk Content-Type: multipart/mixed; boundary=Apple-Mail-1678970388-1 X-Mailer: Apple Mail (2.343) From: Stuart Roebuck To: ant-dev@jakarta.apache.org Mime-Version: 1.0 (Apple Message framework v343) Content-Transfer-Encoding: 7bit Subject: [PATCH] optional/net/FTP Automatic make directory fault Message-Id: X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N --Apple-Mail-1678970388-1 content-transfer-encoding: quoted-printable content-type: text/plain; charset=us-ascii I've come across an FTP server which returns code 553 in response to a = make directory command on an existing directory. Currently the FTP task = only accepts 550 errors as acceptable, so I've added in 553 as well. The consequence of this fault was that you couldn't FTP files onto a = server if the files included directories of files, and the directories = already existed on the server before the FTP command was issued. Here's the patch: Index: src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: = /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optiona= l/net/FTP.java,v retrieving revision 1.4 diff -u -r1.4 FTP.java --- src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java = 2001/01/03 14:18:45 1.4 +++ src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java = 2001/01/10 16:33:00 @@ -512,8 +512,11 @@ log("creating remote directory " + = resolveFile(dir.getPath()), Project.MSG_VERBOSE); ftp.makeDirectory(resolveFile(dir.getPath())); + // Both codes 550 and 553 can be produced by FTP = Servers + // to indicate that an attempt to create a directory = has + // failed because the directory already exists. if (!FTPReply.isPositiveCompletion(ftp.getReplyCode()) = && - (ftp.getReplyCode() !=3D 550)) + (ftp.getReplyCode() !=3D 550) && = (ftp.getReplyCode() !=3D 553)) { throw new BuildException( "could not create = directory: " + --Apple-Mail-1678970388-1 content-disposition: attachment; filename=changes.patch.zip content-type: application/octet-stream; name=changes.patch.zip; x-unix-mode=0644 content-transfer-encoding: base64 UEsDBBQAAAAIACKEKir7rEMC5wEAANAEAAANABAAY2hhbmdlcy5wYXRjaFVYDACNj1w6wI5cOmYA FACtUlFv2kAMfm5+hctDFRSSSwpMVaZKCEanPUxDMO11MheHHCS56O6Sgvrnd8fUqiqgPTArknXx 58/2Z3+rM9qnoBVnFYqaSbVh2CAviBkpS82wNsyg3mWUayYbI2SNJavJsKefi2iLHXqP15u3nK0g FyWlwApZEeOdbtp1KTjb4g6VwdA1ck2bg85TZJSgTtQbUNZpC4IkGnmZyHMIWwiVfcHbXGEYXiXM zX0cJ8x9Q0hGafKQjsY3rl4QBP+HOIkh+ZQOh2kce5MJhOPkfvAAgXNJApOJBx+tlBu/xxWh+atC JQ1BJhRxI9UBehDYn1qWHT3Zbfg2Em3ILNAUfr8/OOVztlBya/Oj76uvv3/Nl9Mfq3n/8yk0N01U 4Y6+vFbzL1ey+cHHfMZgKk0BXGakYTyOAevM+iFwrGFN0CiZtZwyWB/cEmFFqiOlzzKBkSDqTHC0 85sCjSUDNIaqxrjYUSICfKdNgReocrQD2KrEsdWO7b2iWFqm7AC0F9ro6FQWkYN/a9tdUlMeIqEX UgsjOprJqinJbd93ylltjoiZnd4KBHd3XnhuGWfAcPvo5Or3T9v/R4atcjk8tIQnZC/nT8QUSj5D Tc8wbUWZzfecjoftn4dftB6XbZlBLc3rht6UTt3xen8AUEsBAhUDFAAAAAgAIoQqKvusQwLnAQAA 0AQAAA0ADAAAAAAAAQAAQKSBAAAAAGNoYW5nZXMucGF0Y2hVWAgAjY9cOsCOXDpQSwUGAAAAAAEA AQBHAAAAIgIAAAAA --Apple-Mail-1678970388-1 content-transfer-encoding: 7bit content-type: text/plain; charset=us-ascii ------------------------------------------------------------------------- Stuart Roebuck stuart.roebuck@adolos.com Lead Developer Java, XML, MacOS X, XP, etc. ADOLOS http://www.adolos.com/ --Apple-Mail-1678970388-1--