code: private static void joinPath(StringBuilder path, String parent, String child)
      {
          // Add parent piece, with no trailing slash.
          if ( (parent != null) && (parent.length() > 0) )
          {
              if ( !parent.startsWith(PATH_SEPARATOR) )
              {
                  path.append(PATH_SEPARATOR);
              }
              if ( parent.endsWith(PATH_SEPARATOR) )
              {
                  path.append(parent.substring(0, parent.length() - 1));
              }
              else
              {
                  path.append(parent);
              }
          }
  
          if ( (child == null) || (child.length() == 0) || (child.equals(PATH_SEPARATOR)) )
          {
              // Special case, empty parent and child
              if ( path.length() == 0 )
              {
                  path.append(PATH_SEPARATOR);
              }
              return;
          }
  
          // Now add the separator between parent and child.
          path.append(PATH_SEPARATOR);
  
          if ( child.startsWith(PATH_SEPARATOR) )
          {
              child = child.substring(1);
          }
  
          if ( child.endsWith(PATH_SEPARATOR) )
          {
              child = child.substring(0, child.length() - 1);
          }
  
          // Finally, add the child.
          path.append(child);
      }
docs: Given a parent and a child node, join them in the given {@link StringBuilder path}
  
  @param path   the {@link StringBuilder} used to make the path
  @param parent the parent
  @param child  the child