You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Martijn Kruithof <jm...@kruithof.xs4all.nl> on 2006/03/25 23:42:40 UTC
Re: task FTP ... check file.isUnknown
Henrik Sorensen schreef:
>Hi List,
>
>Before starting to send patches, I would like some feedback on some of the
>changes I have had to do inorder to correctly to receive files and
>directories from a MVS server.
>A number of these changes could be added independently of the actual type of
>server being used.
>
>
>the two functions
>
>isFunctioningAsFile
>and
>isFunctioningAsDirectory
>
>is not taking into account that the file type can be unknown, so a check is
>added:
>
>
> private boolean isFunctioningAsDirectory(FTPClient ftp, String dir, FTPFile
>file) {
> boolean result = false;
> String currentWorkingDir = null;
> if (file.isDirectory()) {
> return true;
> } else if (file.isFile()) {
> return false;
> } else if (file.isUnknown()) {
> return false;
> }
> ...
>}
>
> private boolean isFunctioningAsFile(FTPClient ftp, String dir, FTPFile
>file) {
> if (file.isDirectory()) {
> return false;
> } else if (file.isFile()) {
> return true;
> } else if (file.isUnknown()) {
> return false;
> }
>
> return !isFunctioningAsDirectory(ftp, dir, file);
> }
>
>
>
>I am aware of different mailing lists have different ways of dealing with
>discussions, but I intend to send a number of similar mails, for other
>possible bugs in the FTP.java code, so please inform me if you would rather
>prefer this to be done differently.
>
>Henrik
>
Please use bugzilla to report (possible) bugs and code enhancements.
Please see
http://ant.apache.org/bugs.html
Martijn
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org