I wonder what the list thinks about adding a dispose() method to the
org.apache.ftpserver.ftplet.FileSystemView interface either directly
or by extending org.apache.ftpserver.ftplet.Component.

In an implementation of a file system, there may be per connection
locking or something similar which needs to be cleanly removed when
the connection is dropped.

Currently I have a local modification that adds a dispose to the
FileSystemView interface, which is implemented in both
org.apache.ftpserver.filesystem.NativeFileSystemView and
org.apache.ftpserver.filesystem.OSVirtualFileSystemView as blank
methods.

Then I call the dispose method within the
org.apache.ftpserver.RequestHandler.close() method...

*** RequestHandler.java~        Tue Oct  4 12:31:27 2005
--- RequestHandler.java Wed Dec 14 11:37:32 2005
***************
*** 336,341 ****
--- 336,342 ----
              request.clear();
              request.setObserver(null);
              request.getFtpDataConnection().dispose();
+             request.getFileSystemView().dispose();
              m_request = null;
          }

This nicely cleans up the things I need in my FileSystemView
implementation when the client quits or is timed out.

- Dave.

Reply via email to