docs: public static String getRelativeUri(String fromUri, String toUri) {
  
          StringBuffer result = new StringBuffer();
          int pos = 0;
  
          while (true) {
              int i = fromUri.indexOf('/', pos);
              int j = toUri.indexOf('/', pos);
              if ((i == -1) || (i != j) || !fromUri.regionMatches(pos, toUri, pos, i - pos)) {
                  break;
              }
              pos = i + 1;
          }
  
          // count hops up from here to the common ancestor
          for (int i = fromUri.indexOf('/', pos); i > 0; i = fromUri.indexOf('/', i + 1)) {
              result.append("../");
          }
  
          // append path down from common ancestor to there
          result.append(toUri.substring(pos));
  
          if (result.length() == 0) {
              // special case: relative link to the parent folder from a file in that folder
              result.append("./");
          }
  
          return result.toString();
      }