Lines Matching defs:path

51     static String readLink(WindowsPath path) throws IOException {
54 handle = path.openForReadAttributeAccess(false); // don't follow links
56 x.rethrowAsIOException(path);
66 * Returns the final path (all symbolic links resolved) or null if this
90 * Returns the final path of a given path as a String. This should be used
98 // if not following links then don't need final path
102 // if file is not a sym link then don't need final path
110 // The file is a symbolic link so attempt to get the final path
134 // no parent so use parent of absolute path
153 * Returns the actual path of a file, optionally resolving all symbolic
161 // Start with absolute path
162 String path = null;
164 path = input.toAbsolutePath().toString();
170 if (path.indexOf('.') >= 0) {
172 path = GetFullPathName(path);
178 // string builder to build up components of path
179 StringBuilder sb = new StringBuilder(path.length());
183 char c0 = path.charAt(0);
184 char c1 = path.charAt(1);
186 c1 == ':' && path.charAt(2) == '\\') {
193 int last = path.length() - 1;
194 int pos = path.indexOf('\\', 2);
201 pos = path.indexOf('\\', pos+1);
204 sb.append(path).append("\\");
206 sb.append(path, 0, pos+1);
210 throw new AssertionError("path type not recognized");
214 if (start >= path.length()) {
219 x.rethrowAsIOException(path);
227 while (curr < path.length()) {
228 int next = path.indexOf('\\', curr);
229 int end = (next == -1) ? path.length() : next;
230 String search = sb.toString() + path.substring(curr, end);
236 // final path.
242 // Fallback to slow path, usually because there is a sym
245 WindowsPath.createFromNormalizedPath(fs, path));
257 e.rethrowAsIOException(path);
342 * Resolve all symbolic-links in a given absolute and normalized path
344 private static WindowsPath resolveAllLinks(WindowsPath path)
347 assert path.isAbsolute();
348 WindowsFileSystem fs = path.getFileSystem();
350 // iterate through each name element of the path, resolving links as
354 while (elem < path.getNameCount()) {
355 WindowsPath current = path.getRoot().resolve(path.subpath(0, elem+1));
367 * part of the path against the result. The target of the link
378 int count = path.getNameCount();
380 remainder = path.subpath(elem+1, count);
382 path = current.getParent().resolve(target);
384 String full = GetFullPathName(path.toString());
385 if (!full.equals(path.toString())) {
386 path = WindowsPath.createFromNormalizedPath(fs, full);
389 x.rethrowAsIOException(path);
392 path = path.resolve(remainder);
403 return path;
407 * Strip long path or symbolic link prefix from path
409 private static String stripPrefix(String path) {
410 // prefix for resolved/long path
411 if (path.startsWith("\\\\?\\")) {
412 if (path.startsWith("\\\\?\\UNC\\")) {
413 path = "\\" + path.substring(7);
415 path = path.substring(4);
417 return path;
421 if (path.startsWith("\\??\\")) {
422 if (path.startsWith("\\??\\UNC\\")) {
423 path = "\\" + path.substring(7);
425 path = path.substring(4);
427 return path;
429 return path;