如何使用ANT'列出目录;SFTP上的SCP任务?

如何使用ANT'列出目录;SFTP上的SCP任务?,ant,groovy,sftp,Ant,Groovy,Sftp,in-ant允许您使用以下语法列出给定目录: <ftp action="list" server="ftp.apache.org" userid="admin" password="${password}" listing="c:\\temp\\listing-temp.txt"> <fileset> <include name="response/*.zip"/> <

in-ant允许您使用以下语法列出给定目录:

  <ftp action="list"
       server="ftp.apache.org"
       userid="admin"
       password="${password}"
       listing="c:\\temp\\listing-temp.txt">
    <fileset>
      <include name="response/*.zip"/>
    </fileset>
  </ftp>
当需要在SFTP协议上工作时,主要使用。但是,我没有看到任何使用SCP任务在SFTP上列出的机制。是否有已知的技术可以使用scp任务执行列表?我现在唯一的选择就是将文件作为“列表”下拉。我真的希望只列出内容,避免向下拉文件的开销

ant.scp(
            file: "aUserID@sftp.apache.org:$path/*.zip",
            toDir: "C:\\dev\\tmp",
            password: "$password",
            trust: 'true',
            verbose: "false",
            sftp: "true")

请参阅:@martinclayton sshexec是否应用于以前仅使用SFTP访问的服务器?当使用sshexec时,我得到了“远程命令失败,退出状态为255”,但scp确实有效。scp表示“通过ssh复制”,因此它只提供“复制”功能。
ant.scp(
            file: "aUserID@sftp.apache.org:$path/*.zip",
            toDir: "C:\\dev\\tmp",
            password: "$password",
            trust: 'true',
            verbose: "false",
            sftp: "true")