prefix/dir1/dir2/dir3/dir4/..
How to parse the dir1, dir2 values out of the above string in Java?
dir1, dir2
The prefix here c
If it's a File, you can get the parts by creating an instanceof File and then ask for its segments.
This is good because it'll work regardless of the direction of the slashes; it's platform independent (except for the "drive letters" in windows...)