I have two File
objects:
- C:/basepath/
- C:/basepath/directory/file.txt
Now I would like to subtract file 1 from file 2 so that I get directory/file.txt
.
I don't want to use String.substring()
since file paths may differ from input.
I have two File
objects:
Now I would like to subtract file 1 from file 2 so that I get directory/file.txt
.
I don't want to use String.substring()
since file paths may differ from input.
Use the features of java.nio.file.Path
. You are looking to 'relativize'.