If I get your problem right, you could do something like this:
File a = new File("/some/abs/path");
File parentFolder = new File(a.getParent());
File b = new File(parentFolder, "../some/relative/path");
String absolute = b.getCanonicalPath(); // may throw IOException
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…