Lines Matching defs:path

46     // The maximum path that does not require long path prefix. On Windows
47 // the maximum path is 260 minus 1 (NUL) but for directories it is 260
52 // Maximum extended-length path
58 // path type
62 // normalized path
63 private final String path;
65 // the path to use in Win32 calls. This differs from path for relative
66 // paths and has a long path prefix for all paths longer than MAX_PATH.
82 String path)
87 this.path = path;
91 * Creates a Path by parsing the given path.
93 static WindowsPath parse(WindowsFileSystem fs, String path) {
94 WindowsPathParser.Result result = WindowsPathParser.parse(path);
95 return new WindowsPath(fs, result.type(), result.root(), result.path());
99 * Creates a Path from a given path that is known to be normalized.
102 String path,
107 WindowsPathParser.parseNormalizedPath(path);
112 result.path());
117 result.path(),
126 * Creates a WindowsPath from a given path that is known to be normalized.
129 String path)
131 return createFromNormalizedPath(fs, path, null);
146 String path,
149 super(fs, type, root, path);
168 return path;
171 // use this path for permission checks
173 return path;
176 // use this path for Win32 calls
180 if (isAbsolute() && path.length() <= MAX_PATH)
181 return path;
187 // Win32 path already available
201 throw new WindowsException("Cannot access file with path exceeding "
207 // cache the resolved path (except drive relative paths as the working
211 synchronized (path) {
218 // return this path resolved against the file system's default directory
221 return path;
223 // Relative path ("foo" for example)
229 return defaultDirectory + path;
232 new StringBuilder(defaultDirectory.length() + path.length() + 1);
233 return sb.append(defaultDirectory).append('\\').append(path).toString();
237 // Directory relative path ("\foo" for example)
240 return defaultRoot + path.substring(1);
243 // Drive relative path ("C:foo" for example).
246 String remaining = path.substring(root.length());
269 result += path.substring(root.length());
271 if (path.length() > root.length())
272 result += "\\" + path.substring(root.length());
284 // Add long path prefix to path if required
285 static String addPrefixIfNeeded(String path) {
286 if (path.length() > MAX_PATH) {
287 if (path.startsWith("\\\\")) {
288 path = "\\\\?\\UNC" + path.substring(1, path.length());
290 path = "\\\\?\\" + path;
293 return path;
304 return path.length() == 0;
313 int len = path.length();
314 // represents empty path
320 int off = path.lastIndexOf('\\');
325 return new WindowsPath(getFileSystem(), WindowsPathType.RELATIVE, "", path.substring(off));
331 if (root.length() == path.length())
333 int off = path.lastIndexOf('\\');
340 path.substring(0, off));
361 if (path.endsWith("\\"))
363 return path.length() > root.length();
371 static WindowsPath toWindowsPath(Path path) {
372 if (path == null)
374 if (!(path instanceof WindowsPath)) {
377 return (WindowsPath)path;
507 // re-constitute the path from the remaining names.
534 if (path.endsWith("\\") || (root.length() == path.length())) {
535 result = path + other.path;
537 result = path + "\\" + other.path;
545 result = root + other.path.substring(1);
547 result = root + other.path;
560 String remaining = other.path.substring(other.root.length());
562 if (path.endsWith("\\")) {
563 result = path + remaining;
565 result = path + "\\" + remaining;
580 // empty path considered to have one name element
585 while (off < path.length()) {
586 if (path.charAt(off) != '\\') {
612 return path.substring(offsets[i]);
613 return path.substring(offsets[i], offsets[i+1]-1);
653 // if this path has a root component the given path's root must match
658 // empty path starts with itself
684 // other path is longer
685 if (other.path.length() > this.path.length()) {
689 // empty path ends in itself
697 // given path has more elements that this path
727 String s1 = path;
728 String s2 = ((WindowsPath)obj).path;
759 for (int i = 0; i< path.length(); i++) {
760 h = 31*h + Character.toUpperCase(path.charAt(i));
769 return path;