Urgent help! Java relative file path# Java - 爪哇娇娃
c*t
1 楼
Assume that I have two paths.
String fileA = "E:\\testDir\\abc";
String fileB = "..\\def.txt";
fileA is a directory.
Now, I want to find the actual path fileB resides on. How?
Also consider the case:
fileB = "F:\\temp\\def.txt";
I know that I can solve the problem by changing the current
directory to fileA, but that would cause undesired side effects.
So, any solutions?
Another question is basically the reverse. If I have
fileA = "E:\\testDir\\abc";
file
String fileA = "E:\\testDir\\abc";
String fileB = "..\\def.txt";
fileA is a directory.
Now, I want to find the actual path fileB resides on. How?
Also consider the case:
fileB = "F:\\temp\\def.txt";
I know that I can solve the problem by changing the current
directory to fileA, but that would cause undesired side effects.
So, any solutions?
Another question is basically the reverse. If I have
fileA = "E:\\testDir\\abc";
file