Lines Matching refs: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
163 // Start with absolute path
164 String path = null;
166 path = input.toAbsolutePath().toString();
172 if (path.indexOf('.') >= 0) {
174 path = GetFullPathName(path);
180 // string builder to build up components of path
181 StringBuilder sb = new StringBuilder(path.length());
185 char c0 = path.charAt(0);
186 char c1 = path.charAt(1);
188 c1 == ':' && path.charAt(2) == '\\') {
195 int last = path.length() - 1;
196 int pos = path.indexOf('\\', 2);
203 pos = path.indexOf('\\', pos+1);
206 sb.append(path).append("\\");
208 sb.append(path, 0, pos+1);
212 throw new AssertionError("path type not recognized");
216 if (start >= path.length()) {
221 x.rethrowAsIOException(path);
229 while (curr < path.length()) {
230 int next = path.indexOf('\\', curr);
231 int end = (next == -1) ? path.length() : next;
232 String search = sb.toString() + path.substring(curr, end);
238 // final path.
244 // Fallback to slow path, usually because there is a sym
247 WindowsPath.createFromNormalizedPath(fs, path));
259 e.rethrowAsIOException(path);
344 * Resolve all symbolic-links in a given absolute and normalized path
346 private static WindowsPath resolveAllLinks(WindowsPath path)
349 assert path.isAbsolute();
350 WindowsFileSystem fs = path.getFileSystem();
352 // iterate through each name element of the path, resolving links as
356 while (elem < path.getNameCount()) {
357 WindowsPath current = path.getRoot().resolve(path.subpath(0, elem+1));
369 * part of the path against the result. The target of the link
380 int count = path.getNameCount();
382 remainder = path.subpath(elem+1, count);
384 path = current.getParent().resolve(target);
386 String full = GetFullPathName(path.toString());
387 if (!full.equals(path.toString())) {
388 path = WindowsPath.createFromNormalizedPath(fs, full);
391 x.rethrowAsIOException(path);
394 path = path.resolve(remainder);
405 return path;
409 * Strip long path or symbolic link prefix from path
411 private static String stripPrefix(String path) {
412 // prefix for resolved/long path
413 if (path.startsWith("\\\\?\\")) {
414 if (path.startsWith("\\\\?\\UNC\\")) {
415 path = "\\" + path.substring(7);
417 path = path.substring(4);
419 return path;
423 if (path.startsWith("\\??\\")) {
424 if (path.startsWith("\\??\\UNC\\")) {
425 path = "\\" + path.substring(7);
427 path = path.substring(4);
429 return path;
431 return path;