I am trying to print all parent folders from the path specified using Java.
For instance,I got this path
/root/p0/p1/p2/p3/report Now my expected output is
/root/p0/p1/p2/p3 /root/p0/p1/p2 /root/p0/p1 /root/p0 /root How can we do this in Java? Any pre-defined functions exist in Java or by looping it? How to loop this path and get the expected parent url's?
/and off you go.