Added dircheck parameter to scanDirectory method in Sftp

This will stop the method from going into the rabbit hole when there is no need. I am not sure this would be the way to do it I think it is at least an improvement.