I am using System.getProperty("user.dir") to get my CWD.
I then trim off the last \token to give me the parent directory.
My question is , is there any easier way to do it? I want the current working directory, cd up one level and then drill into a sub folder in another project.
I run my unit tests in \\projectA\test but I want to get the path to another folder contained in a project at the same level. ie folder \\projectB\otherTestData
Check
getparentandgetParentFilemethods in File class.For more details see here