I am using the Mina FTPServer together with Apache Commons VFS to provide FTP access to the Documentum CMS. I created an alternative file system manager implementation for the FTPServer to bridge to the VFS (more details can be found at http://dctmvfs.sourceforge.net/ftpserver-vfs). Documentum access is realized using a plugin for VFS
To import in Documentum I need to work with files, while the FTP (and VFS) interfaces work with streams. I solved this by using a handler on the close event of the stream that does the actual import. Since all kinds of errors can occur, these errors arrive in the FTP server on the close method on the stream, which are ignored for the moment. FTP clients therefore think the transfer was successful. Since I think the close is a major event in interfaces like this, I suggest to stop ignoring the possible exceptions. For for example by adding a close on the stream right after the method that uses the stream and to only ignore exceptions on a close in the finally block. The exact error message that should be sent can be a 551 as is the current IOException handling; but perhaps there are better options, I'm not too familiar with FTP error codes. Does anyone have any comments? Best regards, Frank Below, I've put my original JIRA request and Niklas Gustavssons comment. > Date: Sun, 6 Apr 2008 13:20:25 -0700 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: [jira] Commented: (FTPSERVER-119) STOR command should not eat > exceptions when closing stream > > > [ > https://issues.apache.org/jira/browse/FTPSERVER-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586175#action_12586175 > ] > > Niklas Gustavsson commented on FTPSERVER-119: > --------------------------------------------- > > So, if I understand your request, you would like us to send a "551 Error on > output file" error message in an exception is thrown during close? If so, > please start a discussion on the dev list (dev@mina.apache.org) as it might > affect other people, just to make sure we do the right thing. > > > STOR command should not eat exceptions when closing stream > > ---------------------------------------------------------- > > > > Key: FTPSERVER-119 > > URL: https://issues.apache.org/jira/browse/FTPSERVER-119 > > Project: FtpServer > > Issue Type: Improvement > > Components: Core > > Affects Versions: 1.0 > > Environment: na > > Reporter: Frank > > Priority: Minor > > > > When the STOR commands closes the outputstream, it uses > > IOUtils.close(OutputStream) in a finally block which eats all exceptions. > > Wouldn't it be possible to first do a normal close on the stream after > > dataConnection.transferFromClient(outStream) and only eat exceptions on > > close in the finally block? > > Is there a reason for always eating close exceptions? > > If you consider changing it, would you also do it on branch1.4? > > I'll describe my motivation below: > > I have created a custom FileSystemManager based on Commons VFS. One of the > > VFS plugins I use stores the output stream temporarily as a file and then > > further handles the file when close is called on the output stream. > > When something goes wrong passing the file to lower levels an exception is > > thrown, but the exception gets eaten by IOUtils.close and a success message > > is sent to the FTP client. FileZilla for example already shows the file > > being transferred since it doesn't do a new directory listing, so for users > > it's quite difficult to find failed transfers. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/