* For each file in the fileset, do the appropriate action: send, get,
* delete, or list.
*/
protected int transferFiles(FTPClient ftp, FileSet fs)
throws IOException, BuildException {
FileScanner ds;
if (action == SEND_FILES) {
ds = fs.getDirectoryScanner(project);
} else {
ds = new FTPDirectoryScanner(ftp);
fs.setupDirectoryScanner(ds, project);
ds.scan();
}
String[] dsfiles = ds.getIncludedFiles();
String dir = null;
if ((ds.getBasedir() == null)
&& ((action == SEND_FILES) || (action == GET_FILES))) {
throw new BuildException("the dir attribute must be set for send "
+ "and get actions");
} else {
if ((action == SEND_FILES) || (action == GET_FILES)) {
dir = ds.getBasedir().getAbsolutePath();
}
}
// If we are doing a listing, we need the output stream created now.
BufferedWriter bw = null;