commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: [VFS] FtpFileSystem and passive connections
Date Sun, 16 Mar 2003 19:58:13 GMT

In message <002d01c2ebc6$bf965e70$0c00000a@stringfellow>, "Mario Ivankovits" wr
ites:
>1) switch to passive mode by environment setting and code this in =
>"FTPClient.createConnection()"
>- this is an global setting, but it might depend on the destination host =
>what of active/passive has to be selected

There is no createConnection() method in FTPClient (assuming you're talking
about Commons Net).  Second, there is little chance we're going to make
FTPClient behavior dependent on hardcoded system properties.  The approach taken
in Commons Net is to make behavior programmatically defined (i.e., through
the API) and allow applications using the library to decide whether they
want to define specific properties that have meaning to the application and
allow the application to respond to those properties and set FTPClient
or other Commons Net class behavior through the API.  In other words, if
you want VFS to use passive mode, have VFS make some provision for calling
FTPClient.enterLocalPassiveMode() from VFS.  Messing with FTPClient is the
wrong thing to do.

>4) ??
>
>If you preferre 2, i would like to vote to make =
>"FTPClient.createConnection()" protected instead of "private" so i could =
>override this function and set the connection to passive mode in an new =
>"FtpPasvFileSystem" class.

Again, this is just a bad thing to do.  You don't have to and should not
touch FTPClient.  In your VFS classes, call FTPClient.enterLocalPassiveMode()
after logging in to the FTP server.  I don't have any comment about how this
should be done as I am not involved in VFS development (although everyone
involved with Commons Net is certainly happy to serve its needs).  I only
want to stress that what you're asking for is the responsibility of the
application or API built on top of Commons Net and not the responsibility of
Commons Net since FTPClient already exposes the desired functionality to be
manipulated as appropriate by the consumer of the API.

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