我是groovy的新手我需要从ftp站点读取文件并将其作为流发回。下面的代码实际下载到本地目录。如何修改,以便我可以发送流。
import org.apache.commons.net.ftp.FTPClient
import org.apache.commons.io.IOUtils
new FTPClient().with {
connect "abc.efg.pqr"
enterLocalPassiveMode()
login "xxx", "yyy"
changeWorkingDirectory "/xyz/pqr/"
def fileName = message.getInvocationProperty('fileName')
log.debug("File Name " + fileName)
def incomingFile = new File("/Users/abc/"+fileName)
incomingFile.withOutputStream { ostream -> retrieveFile fileName, ostream }
disconnect()