我正在编写 Scala 代码。使用 Rapture 在 Windows 上操作文件时,编写 URI 的正确路径模式是什么?我添加了以下依赖项:
libraryDependencies += "com.propensive" %% "rapture" % "2.0.0-M3" exclude("com.propensive","rapture-json-lift_2.11")
这是我的代码的一部分:
import rapture.uri._
import rapture.io._
val file = uri"file:///C:/opt/eric/spark-demo"
file.delete()
但我得到了消息:
Error:(17, 16) value file is not a member of object rapture.uri.UriContext
val file = uri"file:///C:/opt/eric/spark-demo"
或者我试过这个:
val file = uri"file://opt/eric/spark-demo"
同样的错误:
Error:(17, 16) value file is not a member of object rapture.uri.UriContext
val file = uri"file://opt/eric/spark-demo"
我的本地路径是:
C:\opt\eric\spark-demo
我怎样才能避免错误?