public static String resolveBacktracePath(String currentDir,String fileName){
  String result=normalizeFileName(fileName);
  int dotdotCount=DelphiUtils.countSubstrings(result,"..");
  result=result.replaceAll("\\.\\./","");
  for (int i=0; i < dotdotCount; ++i) {
    currentDir=currentDir.substring(0,currentDir.lastIndexOf('/'));
  }
  return currentDir + "/" + result;
}

public static String resolveBacktracePath ( String currentDir , String fileName ) { String result = normalizeFileName ( fileName ) ; int dotdotCount = DelphiUtils . countSubstrings ( result , ".." ) ; result = result . replaceAll ( "\\.\\./" , "" ) ; for ( int i = 0 ; i < dotdotCount ; ++ i ) { currentDir = currentDir . substring ( 0 , currentDir . lastIndexOf ( '/' ) ) ; } return currentDir + "/" + result ; }
resolves . . \ in a path to a file , backtraces the currentdir the number of ' . . ' in a path . example : currentdir = ' c : \ my \ dir ' filename = ' . . \ file . txt ' ; return = ' c : / my / file . txt '
