Why does 'File.exists' return true, even though 'Files.exists' in the NIO 'Files' class returns false
I am trying to determine if a file exists in a network folder: // File name is "\\QWERTY\folder\dir\A123456.TXT" Path path = Paths.get("\\\\QWERTY\\folder\\dir\\A123456.TXT") Using NIO Files : Files.exists(path) == false Using File : path.toFile().exists() == true Using File seems to be the correct one according to our tests. Why does File work better than Files ? So, which is it? Can't be both! But wait, there is also Files.notExists(path) . When the network share file actually exists Files.exists(path): false Files.notExists(path): false path.toFile().exists(): true When the network share