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);
}

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 ) ; }
decode the path component of a uri as path segments .
