Error on FakeFtpServer rename
Brought to you by:
chrismair
Opened this ticket for bug described in https://sourceforge.net/p/mockftpserver/discussion/748298/thread/681b98b9/:
Renaming a directory fails due to descendents returning out of order.
It looks like the AbstractFakeFileSystem.descendents returns a list with children listed ahead of their parent directories. When this is called from rename (line 165) it can return a/b/c1, a/b/c2, a/b, and then fail on renaming the 3rd element since it already exists implicitly by renaming the first two elements. This causes rename operations on directories to fail.
Adding a COllections.sort to the result of the descendents() method appears to fix this.
Diff:
Fixed for MockFtpServer v2.7