I want to compare the below URL with the other one, but every time I hit the URL, the unique code (Highlighted in Bold) is generated. Is there any way to skip the unique code so I can compare the remaining data?
https://stagedesignerimages.net/UserPhoto/0e8a78b2-eea3-475e-b38c-b3ea2b606926/Photos/Output/Standard/cdbd2a4a-8892-443c-8071-9fb27c9144ae-22-07-2022-05-13-17-01836.png
Unique code: cdbd2a4a-8892-443c-8071-9fb27c9144ae-22-07-2022-05-13-17-01836.png
Thanks in advance.
CodePudding user response:
java.net.URI provides a nice method that allows you to resolve a given String (parsed as URI) against it.
E.g.
URI parent = URI.create("https://stagedesignerimages.net/UserPhoto/0e8a78b2-eea3-475e-b38c-b3ea2b606926/Photos/Output/Standard/*cdbd2a4a-8892-443c-8071-9fb27c9144ae-22-07-2022-05-13-17-01836.png")
.resolve(".");
results in URI https://stagedesignerimages.net/UserPhoto/0e8a78b2-eea3-475e-b38c-b3ea2b606926/Photos/Output/Standard/