ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11044] - FTP chmod from Windows-UNIX: wrong separator
Date Wed, 08 Jan 2003 15:29:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11044>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11044

FTP chmod from Windows-UNIX: wrong separator





------- Additional Comments From cmcfarland@onebox.com  2003-01-08 15:29 -------
FYI, these are the changes (hack) I made to FTPDirectoryScanner.scandir() 
method that fixed the chmod action:

        protected void scandir(String dir, String vpath, boolean fast) {
            try {
                if (!ftp.changeWorkingDirectory(dir)) {
                    return;
                }

                FTPFile[] newfiles = ftp.listFiles();

                if (newfiles == null) {
                    ftp.changeToParentDirectory();
                    return;
                }

                for (int i = 0; i < newfiles.length; i++) {
                    FTPFile file = newfiles[i];

                    if (!file.getName().equals(".")
                         && !file.getName().equals("..")) {
                        if (file.isDirectory()) {
                            String name = vpath + file.getName();
                            if (isIncluded(name)) {
                                if (!isExcluded(name)) {
                                    dirsIncluded.addElement(name);
                                    if (fast) {
                                        scandir(file.getName(), 
                                                name + remoteFileSep, 
fast);//chris:chg'd File.separator
                                    }
                                } else {
                                    dirsExcluded.addElement(name);
                                    if (fast && couldHoldIncluded(name)) {
                                        scandir(file.getName(), 
                                                name + remoteFileSep, 
fast);//chris:chg'd File.separator
                                    }
                                }
                            } else {
                                dirsNotIncluded.addElement(name);
                                if (fast && couldHoldIncluded(name)) {
                                    scandir(file.getName(), 
                                            name + remoteFileSep, 
fast);//chris:chg'd File.separator
                                }
                            }
                            if (!fast) {
                                scandir(file.getName(), 
                                        name + remoteFileSep, 
fast);//chris:chg'd File.separator
                            }
                        } else {
                            if (file.isFile()) {
                                String name = vpath + file.getName();

                                if (isIncluded(name)) {
                                    if (!isExcluded(name)) {
                                        filesIncluded.addElement(name);
                                    } else {
                                        filesExcluded.addElement(name);
                                    }
                                } else {
                                    filesNotIncluded.addElement(name);
                                }
                            }
                        }
                    }
                }
                ftp.changeToParentDirectory();
            } catch (IOException e) {
                throw new BuildException("Error while communicating with FTP "
                     + "server: ", e);
            }
        }
    }

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


Mime
View raw message