133. Comparing file paths

Depending on how we perceive the equality between two file paths, there are several solutions to this problem. Mainly, Path equality can be verified in different ways for different goals.

Let's assume that we have the following three paths (consider reproducing path3 on your computer):

Path path1 = Paths.get("/learning/packt/JavaModernChallenge.pdf");
Path path2 = Paths.get("/LEARNING/PACKT/JavaModernChallenge.pdf");
Path path3 = Paths.get("D:/learning/packt/JavaModernChallenge.pdf");

In the following sections, we'll take a look at the different methods that are used to compare file paths.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.71.211