Hello everybody I have a problem to determine the difference between two paths.
Let's say there are two pathes main.cache
and another/system.cache
I would like to get the folder difference between these two paths. For example for these two file it would be another/
.
I do it because I have list of files (per line) in another/system.cache
relative to the system.cache
file.
For example
../images/a.jpg
../images/b.jpg
../images/c.jpg
I need to get the paths relative to the main.cache file so I would just join
another/../images/a.jpg
(and then normalize it to images/a.jpg
)
I was playing with java.nio
and Pathes and trying to solve it with relativize
or resolve
but with no success.
For example relativize
consider main.cache
as folder and returns ../another/system.cache
which is nonsense.
Is there any simple solution I missed? Thanks