使用groovy从远程服务器读取文件

时间:2018-03-30 22:23:50

标签: groovy compiler-errors sftp remote-access datainputstream

我正在尝试读取远程Linux服务器上的文件中的特定条目,我不知道该怎么做,我搜索周围和下面是我正在尝试但它不起作用并抛出异常

以下是我得到的例外,有人还可以确认上述代码是否正常?

 latest.groovy: 50: expecting EOF, found 'in' @ line 50, column 17.
 DataInputStream in = new DataInputStream(io)
               ^

 1 error

1 个答案:

答案 0 :(得分:1)

in是groovy中的关键字。

将变量名称更改为其他内容......

也许dataInputStream

您可以在http://docs.groovy-lang.org/latest/html/documentation/#_keywords

找到关键字列表