code: public static List<PathSegment> decodePath(URI u, boolean decode) {
          String rawPath = u.getRawPath();
          if (rawPath != null && rawPath.length() > 0 && rawPath.charAt(0) == '/') {
              rawPath = rawPath.substring(1);
          }
          return decodePath(rawPath, decode);
      }
docs: Decode the path component of a URI as path segments.
  
  @param u      the URI. If the path component is an absolute path component
  then the leading '/' is ignored and is not considered a delimiator
  of a path segment.
  @param decode true if the path segments of the path component
  should be in decoded form.
  @return the list of path segments.