admin管理员组文章数量:1401256
I'm trying to realize inside ExecuteGroovyScript something like:
import .apachemons.ftp.FTPClient
import .apachemons.ftp.FTP
def ftpClient = new FTPClient()
try{
ftpClient.connect("host")
// some logic
} finally {
if (ftpClient.isConnected()) {
try {
ftpClient.logout()
ftpClient.disconnect()
} catch (IOException e) {
//
}
}
}
But I receive the exception: Unable to resolve class : .apachemons.ftp.FTPClient
May be there no way to realize FTP connection inside ExecuteGroovyScript ?
I'm trying to realize inside ExecuteGroovyScript something like:
import .apachemons.ftp.FTPClient
import .apachemons.ftp.FTP
def ftpClient = new FTPClient()
try{
ftpClient.connect("host")
// some logic
} finally {
if (ftpClient.isConnected()) {
try {
ftpClient.logout()
ftpClient.disconnect()
} catch (IOException e) {
//
}
}
}
But I receive the exception: Unable to resolve class : .apachemons.ftp.FTPClient
May be there no way to realize FTP connection inside ExecuteGroovyScript ?
Share Improve this question asked Mar 25 at 14:26 JellyJelly 1,3325 gold badges26 silver badges58 bronze badges1 Answer
Reset to default 1The nifi-scripting-nar
doesn't include commons-net. You can use @Grab
to add the dependency, see my blog post for an example of how to do this.
本文标签: groovyApache Nifi ExecuteGroovyScript use FTP client inside scriptStack Overflow
版权声明:本文标题:groovy - Apache Nifi ExecuteGroovyScript: use FTP client inside script - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744189735a2594462.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论