Lines Matching refs:pathname
58 /* A normal Unix pathname contains no duplicate slashes and does not end
61 /* Normalize the given pathname, whose length is len, starting at the given
63 private String normalize(String pathname, int len, int off) {
64 if (len == 0) return pathname;
66 while ((n > 0) && (pathname.charAt(n - 1) == '/')) n--;
68 StringBuffer sb = new StringBuffer(pathname.length());
69 if (off > 0) sb.append(pathname.substring(0, off));
72 char c = pathname.charAt(i);
80 /* Check that the given pathname is normal. If not, invoke the real
81 normalizer on the part of the pathname that requires normalization.
82 This way we iterate through the whole pathname string only once. */
83 public String normalize(String pathname) {
84 int n = pathname.length();
87 char c = pathname.charAt(i);
89 return normalize(pathname, n, i - 1);
92 if (prevChar == '/') return normalize(pathname, n, n - 1);
93 return pathname;
96 public int prefixLength(String pathname) {
97 if (pathname.length() == 0) return 0;
98 return (pathname.charAt(0) == '/') ? 1 : 0;