olegz/spring-integration — comment on commit b18ab7cd082f669d8da4a1e702330bb4f9ab52a4
File: spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java line 139
By olegz:

Gary

Could you please look at this code. Unfortunately Apache commons API does not provide a clean method to check if directory exists, so this is the best I can do under the circumstances and fortunately it works great (10 times faster than relying on listDirectries which creates a MetaData object for all files and the bigger the directory the longer it takes). This one works consistently no matter how big is the directory.
Anyway my question is about the port I am providing. Obviously there is a slim chance that this port may be taken. I know you had some utility that would randomly select any open port. Could you please advise?