commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <>
Subject Re: cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser
Date Thu, 19 Feb 2004 08:17:25 GMT

In message <>, 
>       	FTPFile[] results;
>       	if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) 
>== null)
>  -    		return null;
>  +    		return new FTPFile[0];

I don't think that's the right behavior.  Maybe the old behavior wasn't
the best either.  The old behavior was:
    The list of file information contained in the current working directory.
    null if the list could not be obtained or if there are no files in
    the directory.

Perhaps the combination of the old and new is best, which would return
a zero-length FTPFile array if there are no files in a directory, but
would return null if the list could not be obtained.  The thing is
that if a data connection cannot be established, I don't think you
want to be left believing the directory was empty.  Alternatively, an
IOException could be thrown, but I'm not sure if that's necessary
when the control connection is still functioning.  Anyway, it's
something to think about.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message