【发布时间】:2019-08-01 15:57:16
【问题描述】:
我目前正在尝试使用 MatchResult 状态检查文件是否存在于集群中。即使文件存在,它也会返回 NOT_FOUND 状态。
MatchResult matchResult = FileSystems.match(output string)
if(matchResult.status() == MatchResult.Status.NOT_FOUND){
//do some operation
//print file does not exist
}
else{
//print file exists
}
即使文件存在,上述代码也会返回未找到状态。
【问题讨论】:
-
您不应该使用
==而不是=吗?你想比较而不是分配 -
是的,我使用的是 == ,抱歉打错了。有问题已更正
标签: java file apache-beam