Lines Matching refs:path

105  * [<i>scheme</i><tt><b>:</b></tt>][<tt><b>//</b></tt><i>authority</i>][<i>path</i>][<tt><b>?</b></tt><i>query</i>][<tt><b>#</b></tt><i>fragment</i>]
126 * <p> The path component of a hierarchical URI is itself said to be absolute
128 * relative. The path of a hierarchical URI that is either absolute or
133 * <blockquote><table summary="Describes the components of a URI:scheme,scheme-specific-part,authority,user-info,host,port,path,query,fragment">
141 * <tr><td>path</td><td><tt>String</tt></td></tr>
157 * has a path (though it may be empty) and a scheme-specific-part (which at
158 * least contains the path), and may have any of the other components. If the
169 * and <tt>".."</tt> segments from the path component of a hierarchical URI.
178 * the path of the original is resolved against the path of the base and then
287 * RFC 2396 allows escaped octets to appear in the user-info, path, query, and
297 * component. The user-info, path, query, and fragment components differ
488 // Hierarchical URI components: [//<authority>]<path>[?<query>]
497 private transient String path; // null ==> opaque
536 * followed by a non-empty path, a query component, or a fragment
546 * such as <tt>"#foo"</tt> parses as a relative URI with an empty path
578 * user-information, path, query, and fragment components, as well as in
601 * <p> If a scheme is given then the path, if also given, must either be
636 * <li><p> If a path is given then it is appended. Any character not in
661 * @param path Path
666 * If both a scheme and a path are given but the path is relative,
673 String path, String query, String fragment)
678 path, query, fragment);
679 checkPath(s, scheme, path);
686 * <p> If a scheme is given then the path, if also given, must either be
711 * <li><p> If a path is given then it is appended. Any character not in
734 * @param path Path
739 * If both a scheme and a path are given but the path is relative,
746 String path, String query, String fragment)
751 path, query, fragment);
752 checkPath(s, scheme, path);
766 * URI}(scheme,&nbsp;null,&nbsp;host,&nbsp;-1,&nbsp;path,&nbsp;null,&nbsp;fragment);
771 * @param path Path
778 public URI(String scheme, String host, String path, String fragment)
781 this(scheme, null, host, -1, path, null, fragment);
927 * Normalizes this URI's path.
929 * <p> If this URI is opaque, or if its path is already in normal form,
931 * identical to this URI except that its path is computed by normalizing
932 * this URI's path in a manner consistent with <a
945 * <li><p> If the path is relative, and if its first segment contains a
947 * prepended. This prevents a relative URI with a path such as
954 * <p> A normalized path will begin with one or more <tt>".."</tt> segments
956 * allow their removal. A normalized path will begin with a <tt>"."</tt>
958 * path will not contain any <tt>"."</tt> or <tt>".."</tt> segments. </p>
961 * but whose path is in normal form
974 * defined, its path component is empty, and its scheme, authority, and
991 * authority and path are taken from the given URI. </p></li>
994 * this URI, and its path is computed as follows: </p>
998 * <li><p> If the given URI's path is absolute then the new URI's path
1001 * <li><p> Otherwise the given URI's path is relative, and so the new
1002 * URI's path is computed by resolving the path of the given URI
1003 * against the path of this URI. This is done by concatenating all but
1004 * the last segment of this URI's path, if any, with the given URI's
1005 * path and then normalizing the result as if by invoking the {@link
1056 * if the path of this URI is not a prefix of the path of the given URI,
1060 * query and fragment components taken from the given URI and with a path
1061 * component computed by removing this URI's path from the beginning of
1062 * the given URI's path. </p></li>
1140 return path == null;
1292 * Returns the raw path component of this URI.
1294 * <p> The path component of a URI, if defined, only contains the slash
1299 * @return The path component of this URI,
1300 * or <tt>null</tt> if the path is undefined
1303 return path;
1307 * Returns the decoded path component of this URI.
1313 * @return The decoded path component of this URI,
1314 * or <tt>null</tt> if the path is undefined
1317 if ((decodedPath == null) && (path != null))
1318 decodedPath = decode(path);
1406 * <p> When testing the user-information, path, query, fragment, authority,
1435 if (!equal(this.path, that.path)) return false;
1470 h = hash(h, path);
1590 if ((c = compare(this.path, that.path)) != 0) return c;
1796 // If a scheme is given then the path, if given, must be absolute
1798 private static void checkPath(String s, String scheme, String path)
1802 if ((path != null)
1803 && ((path.length() > 0) && (path.charAt(0) != '/')))
1805 "Relative path in absolute URI");
1865 String path,
1891 if (path != null)
1892 sb.append(quote(path, L_PATH, H_PATH));
1913 String path,
1924 path, query);
1969 if (path != null)
1970 sb.append(path);
1992 String path = "";
1997 path = base.substring(0, i + 1);
2005 path = sb.toString();
2009 String np = normalize(path);
2011 // 5.2 (6g): If the result is absolute but the path begins with "../",
2012 // then we simply leave the path as-is
2026 && child.path.equals("") && (child.fragment != null)
2038 ru.path = base.path;
2060 String cp = (child.path == null) ? "" : child.path;
2062 // 5.2 (5): Child path is absolute
2063 ru.path = child.path;
2065 // 5.2 (6): Resolve relative path
2066 ru.path = resolvePath(base.path, cp, base.isAbsolute());
2074 ru.path = child.path;
2081 // If the given URI's path is normal then return the URI;
2082 // o.w., return a new URI containing the normalized path.
2085 if (u.isOpaque() || (u.path == null) || (u.path.length() == 0))
2088 String np = normalize(u.path);
2089 if (np == u.path)
2099 v.path = np;
2105 // identical, and the base path is a prefix of the child's path, then
2118 String bp = normalize(base.path);
2119 String cp = normalize(child.path);
2128 v.path = cp.substring(bp.length());
2138 // The following algorithm for path normalization avoids the creation of a
2151 // Check the given path to see if it might need normalization. A path
2157 // this test can be performed without invoking path.toCharArray().
2159 static private int needsNormalization(String path) {
2162 int end = path.length() - 1; // Index of last char in path
2163 int p = 0; // Index of next char in path
2167 if (path.charAt(p) != '/') break;
2176 if ((path.charAt(p) == '.')
2178 || ((path.charAt(p + 1) == '/')
2179 || ((path.charAt(p + 1) == '.')
2181 || (path.charAt(p + 2) == '/')))))) {
2188 if (path.charAt(p++) != '/')
2193 if (path.charAt(p) != '/') break;
2206 // Split the given path into segments, replacing slashes with nulls and
2210 // segs.length == Number of segments in path
2213 // All slashes in path replaced by '\0'
2216 static private void split(char[] path, int[] segs) {
2217 int end = path.length - 1; // Index of last char in path
2218 int p = 0; // Index of next char in path
2223 if (path[p] != '/') break;
2224 path[p] = '\0';
2235 if (path[p++] != '/')
2237 path[p - 1] = '\0';
2241 if (path[p] != '/') break;
2242 path[p++] = '\0';
2253 // Join the segments in the given path according to the given segment-index
2256 // path.
2260 // path computed by split, as above, with '\0' having replaced '/'
2263 // path[0] .. path[return value] == Resulting path
2265 static private int join(char[] path, int[] segs) {
2267 int end = path.length - 1; // Index of last char in path
2268 int p = 0; // Index of next path char to write
2270 if (path[p] == '\0') {
2272 path[p++] = '/';
2283 while ((p <= end) && (path[p] != '\0'))
2287 path[p++] = '/';
2291 while ((q <= end) && (path[q] != '\0'))
2292 path[p++] = path[q++];
2295 path[p++] = '/';
2305 // Remove "." segments from the given path, and remove segment pairs
2308 private static void removeDots(char[] path, int[] segs) {
2310 int end = path.length - 1;
2318 if (path[p] == '.') {
2322 } else if (path[p + 1] == '\0') {
2325 } else if ((path[p + 1] == '.')
2327 || (path[p + 2] == '\0'))) {
2350 if (!((path[q] == '.')
2351 && (path[q + 1] == '.')
2352 && (path[q + 2] == '\0'))) {
2362 // DEVIATION: If the normalized path is relative, and if the first
2365 private static void maybeAddLeadingDot(char[] path, int[] segs) {
2367 if (path[0] == '\0')
2368 // The path is absolute
2379 // The path is empty, or else the original first segment survived,
2384 while ((p < path.length) && (path[p] != ':') && (path[p] != '\0')) p++;
2385 if (p >= path.length || path[p] == '\0')
2391 path[0] = '.';
2392 path[1] = '\0';
2397 // Normalize the given path string. A normal path string has no empty
2405 // Does this path need normalization?
2411 char[] path = ps.toCharArray(); // Path in char-array form
2413 // Split path into segments
2415 split(path, segs);
2418 removeDots(path, segs);
2421 maybeAddLeadingDot(path, segs);
2424 String s = new String(path, 0, join(path, segs));
2569 // All valid path characters
3056 // [//authority]<path>[?<query>]
3059 // long as it's followed by a non-empty path, query component, or
3068 // relative URI with an empty path.
3081 // path, query component or fragment identifier
3086 checkChars(p, q, L_PATH, H_PATH, "path");
3087 path = substring(p, q);