On Mon, Feb 8, 2010 at 8:42 AM, <[email protected]> wrote: > how can I tell the embedded FTP-Server to overwrite existing files. I always > get errors like this: > > 176406 [pool-2-thread-3] INFO > org.apache.ftpserver.listener.nio.FtpLoggingFilter - RECEIVED: RNTO status.txt > 176421 [pool-2-thread-3] INFO > org.apache.ftpserver.listener.nio.FtpLoggingFilter - SENT: 553 Can't rename > file. > > If I delete status.txt the transmission works one time. Then the file exists > again and I get the same error message. > I can't change the programm that sends the files. Is there a way to allow the > RNTO command to delete the existing > file before renaming?
FtpServer does not have an option for this (Googling a bit on this issue, seems like there is disagreement among FTP servers on how this should be handled). You have some options on how to handle this: * Simplest, write you own Ftplet that traps the RNTO and cleans out existing files. * Subclass our file implementation and replace the move() method with one that allows existing files /niklas
