code: public static String getBackToRootPath(final String relativePath, final char fileSeparatorChar) {
  
          checkNotNull("relativePath", relativePath);
  
          final StringBuilder sb = new StringBuilder();
          boolean firstChar = true;
          for (int i = 0; i < relativePath.length(); i++) {
              final char ch = relativePath.charAt(i);
              if (ch == fileSeparatorChar) {
                  sb.append(ch);
                  firstChar = true;
              } else if (firstChar) {
                  sb.append("..");
                  firstChar = false;
              }
          }
          return sb.toString();
      }
docs: Replaces all directory names in a relative path with "..".<br>
  <br>
  Examples:<br>
  "a/b/c" =&gt; "../../.."<br>
  "my-dir" =&gt; ".."<br>
  "my-dir/other/" =&gt; "../../".<br>
  
  @param relativePath
  Relative path to convert - Expected to be a directory and NOT a file - Cannot be NULL.
  @param fileSeparatorChar
  See {@link File#separatorChar}.
  
  @return Relative path with ".." (dot dot)