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("\\
i had a same problem, but your hack doesn't helped me. When file was actually exist all methods returned me false:
Files.exists(path) = false,
path.toFile().exists() = false,
Files.notExists(path) = true,
Files.exists(path) || path.toFile().exists() = false
But if at this moment in the explorer a network directory with this file was opened, then its existence was correctly handled
I solved this problem by creation of a new file in directory (then delete it):
Files.createFile(Paths.get(path.getParent().toString(), "test"));
After that command, apparently, Windows update information about folder