code: public static String buildProperPath(String parentPath, String relativePathFromParent) {
          if (relativePathFromParent == null) return null;
          if (parentPath != null) {
              parentPath = parentPath.trim();
          }
  
          if (relativePathFromParent.startsWith(PATH_CURRENT)) {
              relativePathFromParent = relativePathFromParent.replaceFirst("(./)+", "");
          }
  
          String path;
  
          if (relativePathFromParent.startsWith(PATH_ROOT)) { //absolute
              path = relativePathFromParent;
          } else if (relativePathFromParent.startsWith(PATH_PARENT)) {
              while (relativePathFromParent.startsWith(PATH_PARENT)) {
                  relativePathFromParent = relativePathFromParent.replaceFirst(PATH_PARENT, "");
                  if (relativePathFromParent.startsWith(PATH_CURRENT)) {
                      relativePathFromParent = relativePathFromParent.replaceFirst(PATH_CURRENT, "");
                  }
                  parentPath = (parentPath == null || parentPath.equals(PATH_ROOT)) ? PATH_ROOT : getParentPath(parentPath);
              }
              path = parentPath + PATH_ROOT + relativePathFromParent;
          } else {
              path = parentPath + PATH_ROOT + relativePathFromParent;
          }
  
          return path.replaceAll("(/|\\./)+", "$1");
      }
docs: !TODO might have problems, need to test or replace with something better