Explicitly check for the "sftp" protocol when handling directory listings.