Hi
The reason for this class (and a whole lot of others) being removed is
that we now use MINA for this functionality, meaning we no longer need
to keep our own code.
However, as you noted there is currently no way of finding the active
sessions. How about we provide a method on the Listener:
List<FtpIoSession> getActiveSessions()
That way you could write your code like:
Listener listener = ftpServer.getServerContext().getListener("default");
List<FtpIoSession> sessions = listener.getActiveSessions();
for (FtpIoSession session : sessions) {
if(session.getRemoteAddress().toString().equals("/"+myClient.getAddress())
&&
session.getUser().getName().equals(myClient.getFtpUser())) {
// stop the download ...
}
}
Would that work for you?
/niklas
On Tue, Apr 29, 2008 at 10:45 AM, Zorgan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I used to use the following code to stop the download for a specific client
> :
>
> List<Connection> connections =
> ftpServer.getServerContext().getConnectionManager().getAllConnections();
>
> for (Connection con : connections)
> {
>
>
> if(con.getSession().getClientAddress().toString().equals("/"+myClient.getAddress())
> &&
> con.getSession().getUser().getName().equals(myClient.getFtpUser()))
> {
> // stop the download ...
> }
> }
>
> I just realized that the org.apache.ftpserver.listener.Connection class and
> the getConnectionManager() of the FtpServerContext class were removed.
>
> Does any body know how can I deal with these API changes ?
>