Fixed sftp metadata function

Check if the file/folder actually exists before trying to map the response.