Ron McLeod wrote:I've never used Apache Mina SSHD, but it looks like you can add a SftpEventListener to the SFTP subsystem and hook all kinds of events:
Stephan van Hulst wrote:
Stephan van Hulst wrote:If your main methods keeps blocking after the file has been uploaded because it is waiting for the next file to upload, then you should schedule it in the background as well
Stephan van Hulst wrote:Welcome to CodeRanch!
From your test method, schedule a background task that creates a file in the watched directory. Then call the main method:
You may need to increase the initial delay before the scheduled task is executed if the main method needs more than 500 milliseconds to set up the file watcher.