@Override public List<PathSegment> getPathSegments(boolean decode) { if (decode) { if (decodedPathSegments != null) return decodedPathSegments; return decodedPathSegments = UriComponent.decodePath(getPath(false), true); } else { if (encodedPathSegments != null) return encodedPathSegments; return encodedPathSegments = UriComponent.decodePath(getPath(false), false); } }
@Override public List<PathSegment> getPathSegments(boolean decode) { if (decode) { if (decodedPathSegments != null) return decodedPathSegments; return decodedPathSegments = UriComponent.decodePath(getPath(false), true); } else { if (encodedPathSegments != null) return encodedPathSegments; return encodedPathSegments = UriComponent.decodePath(getPath(false), false); } }
/** * 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. */ 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. * * @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. */ 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); }
@Override public List<PathSegment> getPathSegments(boolean decode) { if (decode) { if (decodedPathSegments != null) return decodedPathSegments; return decodedPathSegments = UriComponent.decodePath(getPath(false), true); } else { if (encodedPathSegments != null) return encodedPathSegments; return encodedPathSegments = UriComponent.decodePath(getPath(false), false); } }