Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,11 @@ object EventMonitorSpec {
override def toString: String = string
}
}
@tailrec
final def realPath(path: Path, fileName: Option[Path] = None): Path = {
val res: Path =
try path.toRealPath()
catch { case _: IOException => null }
if (res != null) fileName.fold(res)(res.resolve)
else {
val newFileName = path.getFileName
realPath(path.getParent, fileName.map(newFileName.resolve) orElse Some(newFileName))
}
val res =
if (Files.exists(path)) path.toRealPath()
else path.toAbsolutePath()
fileName.fold(res)(res.resolve)
}
def pathFilter(path: Path): FileEvent[?] => Boolean = {
val real = realPath(path)
Expand Down
Loading