Hi, I understand that the main focus of the MINA SSHD project is not on the client side, but I felt adventurous today and decided I should try and create a SCP client using it. So far I have implemented a get method and I have some feedback that I want to share after using/reading the code.
1. Using SCP (get) and writing to a file which is located on a path containing a space is not possible if 'ScpCommandFactory.createCommand(String)' is used to create the command (Line 44 makes that impossible). You have to create an 'ScpCommand' instance directly. 2. If something goes wrong executing the 'ScpCommand', 0 is sent to the callback indicating success - it should send 2 if it uses SCP codes (Line 155), there is also a NPE issue here if no callback has been set. 3. I would also suggest a new overloaded method to the 'CommandFactory.ExitCallback.onExit(int)' method, e.g. a 'CommandFactory.ExitCallback.onExit(int exitValue, String error)'. This makes it possible for a client to read the exception message. After dealing with the issues above, getting files via SCP is working fine (but I can't detect if an error occurred at the moment (2)) and the code is a joy to read, great work! Kind Regards Andreas Johansson