SFTP supports comparator and reverse

(cherry picked from commit 12a456fdf4e5f99f5bf4b120b5937d387d2f6d32, 797ec72ebe6512cd7374009d2d9aacf361f3de97, cc95e206a634d3d978e8b43a379dddec14f3d376, abf2fafeea5884d8d22163f5a4871dc06396f7da)