commons-dev mailing list archives

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

In message <20040219021720.16228.qmail@minotaur.apache.org>, scohen@apache.org 
writes:
>       	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:
  Returns:
    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.

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message