In Learn > The Java I/O API > File System Basics > Manipulating Files and Directories, section "Checking Whether Two Paths Locate the Same File" the code below needs a try block as it throws IOException.
if (Files.isSameFile(p1, p2)) {
// Logic when the paths locate the same file
}
Possibly trivial, as it's small and incomplete code example, but it might still aid understanding to know that is required. I also expanded the code example to try some things out, which others may also do, so would save a bit of time to include upfront.
Thanks.
In Learn > The Java I/O API > File System Basics > Manipulating Files and Directories, section "Checking Whether Two Paths Locate the Same File" the code below needs a try block as it throws IOException.
Possibly trivial, as it's small and incomplete code example, but it might still aid understanding to know that is required. I also expanded the code example to try some things out, which others may also do, so would save a bit of time to include upfront.
Thanks.