schemeWalk is called by Path for a scheme lookup like file:/tmp/foo

@param userPath the user's lookup() path
@param attributes the user's attributes
@param filePath the actual lookup() path
@param offset offset into filePath
546559
@Override
  public PathImpl schemeWalk(String userPath,
                         Map<String,Object> attributes,
                         String filePath,
                         int offset)
  {
    String canonicalPath;

    if (offset < filePath.length()
        && (filePath.charAt(offset) == '/'
            || filePath.charAt(offset) == _separatorChar))
      canonicalPath = normalizePath("/", filePath, offset, _separatorChar);
    else
      canonicalPath = normalizePath(_pathname, filePath, offset,
                                    _separatorChar);

    return fsWalk(userPath, attributes, canonicalPath);
  }
652782
def is_path_hidden(filepath):
    

    name = os.path.basename(os.path.abspath(filepath))
    if isinstance(name, bytes):
        is_dotted = name.startswith(b'.')
    else:
        is_dotted = name.startswith('.')
    return is_dotted or _has_hidden_attribute(filepath)
1225868
public static final void setFloatAttribute(Path path, String attribute, float value, LinkOption... options) throws IOException
    {
        attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
        Files.setAttribute(path, attribute, Primitives.writeFloat(value), options);
    }
766936
private void initMapping(String attributePath, String aliasPath)
    {
        Iterator aliasSegmentItr = pathToSegments(aliasPath).iterator();
        String currPath = "";
        String separator = "";
        while (aliasSegmentItr.hasNext())
        {
            currPath = currPath + separator + (String) aliasSegmentItr.next();
            int beginIndex = attributePath.indexOf(currPath);
            if (beginIndex == -1)
            {
                break;
            }
            int endIndex = beginIndex + currPath.length();
            m_mapping.put(attributePath.substring(0, endIndex), m_name);
            separator = ".";
        }
    }
986637
@Override
    public <A extends BasicFileAttributes> A readAttributes(final Path path, final Class<A> type,
        final LinkOption... options) throws IOException {
        if (path == null) {
            throw new IllegalArgumentException("path must be specified");
        }
        if (type == null) {
            throw new IllegalArgumentException("type must be specified");
        }
        if (!type.isAssignableFrom(ShrinkWrapFileAttributes.class)) {
            throw new UnsupportedOperationException("Only supports " + ShrinkWrapFileAttributes.class.getSimpleName()
                + " type");
        }
        if (!(path instanceof ShrinkWrapPath)) {
            throw new IllegalArgumentException("Only " + ShrinkWrapPath.class.getSimpleName() + " is supported");
        }
        final ShrinkWrapPath swPath = (ShrinkWrapPath) path;
        if (!((ShrinkWrapFileSystem) swPath.getFileSystem()).getArchive().contains(path.toString())) {
            throw new NoSuchFileException(path.toString());
        }
        final A attributes = type.cast(new ShrinkWrapFileAttributes((ShrinkWrapPath) path, getArchive(path)));
        return attributes;
    }
623134
public void redirectToApplicationPath(String path) {
        if ("".equals(applicationPath)) {
            // application path is the root
            redirect(path);
        } else {
            redirect(applicationPath + StringUtils.addStart(path, "/"));
        }
    }
566955
private function preventDirectoryTraversal(string $themePath, string $filePath)
    {
        $themePath = realpath($themePath);
        $filePath  = realpath($filePath);

        if ($filePath === false || strpos($filePath, $themePath) !== 0) {
            throw new DirectoryTraversalException('Trying to load a file outside of the theme directory.');
        }
    }
1251161
private boolean validateFilePath(String filePath) {
        if (filePath == null || filePath.isEmpty()) {
            throw new IllegalArgumentException("filePath must be a valid filePath within the file system.");
        }

        // Check if the filename exists as a File -- use an absolute file to ensure we have
        // a parent: even if that parent is ${user.dir} ...
        File loc = new File(filePath).getAbsoluteFile();

        return (loc.exists() || loc.getParentFile().exists());
    }
201346
function parseAttributePath(attrPath, context) {
    const parsed = attrPath.split('.');
    parsed.forEach(item => checkIdentifier(item, context));
    return parsed;
}
187630
public static void xmlAttributeInexistent(String path, String attributeName, Class<?> aClass){
		throw new XmlMappingAttributeDoesNotExistException (MSG.INSTANCE.message(xmlMappingAttributeDoesNotExistException2,attributeName,aClass.getSimpleName(),path));
	}
769404
function isPathAccessible (filePath) {
  try {
    fs.accessSync(filePath)
    debug(`Utils: isPathAccessible(): ${filePath} exists`)
    return true
  } catch (err) {
    debug(`Utils: isPathAccessible(): ${filePath} does not exist`)
    return false
  }
}
261862
public void filterPaths(PathImpl path, String prefix, PathCallback cb)
  {
    if (! path.exists() || ! path.canRead()) {
      return;
    }
    
    if (! isValidPrefix(path, prefix)) {
      return;
    }
    
    if (path.isDirectory()) {
      try {
        String []list = path.list();

        for (int i = 0; i < list.length; i++) {
          String name = list[i];
          
          if (".".equals(name) || "..".equals(name))
            continue;
          
          // jsp/187j
          PathImpl subpath = path.lookup("./" + name);
          
          filterPaths(subpath, prefix, cb);
        }
      } catch (IOException e) {
        log.log(Level.WARNING, e.toString(), e);
      }
    }
    
    if (path.exists()) {
      // server/2438 - logging on unreadable
      //  if (path.canRead()) {
      if (isMatch(path, prefix)) {
        String suffix = "";
        String fullPath = path.getPath();

        if (prefix.length() < fullPath.length())
          suffix = path.getPath().substring(prefix.length());

        path.setUserPath(_userPathPrefix + suffix);

        cb.onMatch(path);
      }
    }
  }
865329
private void registerPathMapping(PathMapping pathMapping, String filePath) throws IOException {
		if (filePath != null) {

			Path p = Paths.get(filePath);
			boolean isDir = Files.isDirectory(p);
			if (!isDir) {
				p = p.getParent();
			}

			if (pathMapping.isRecursive()) {
				registerAll(p, Arrays.asList(pathMapping));
			} else {
				register(p, Arrays.asList(pathMapping));
			}
		}
	}
941097
@Programmatic
    public List<ApplicationUser> findByAtPath(final String atPath) {
        return container.allMatches(new QueryDefault<>(
                ApplicationUser.class,
                "findByAtPath", "atPath", atPath));
    }
1370621
private synchronized void checkPath(String logPath) throws ParameterException {
		Validate.notNull(path);
		File cPath = new File(logPath);
		if(!cPath.exists())
			cPath.mkdirs();
		if(!cPath.isDirectory())
			throw new ParameterException(ErrorCode.INCOMPATIBILITY, logPath + " is not a valid path!");
	}
632154
@Override
  public PathImpl schemeWalk(String userPath,
                         Map<String,Object> attributes,
                         String filePath,
                         int offset)
  {
    int length = filePath.length();

    if (length <= offset || filePath.charAt(offset) != '(')
      return super.schemeWalk(userPath, attributes, filePath, offset);

    MergePath mergePath = createMergePath();
    mergePath.setUserPath(userPath);

    int head = ++offset;
    int tail = head;
    while (tail < length) {
      int ch = filePath.charAt(tail);

      if (ch == ')') {
        if (head + 1 != tail) {
          String subPath = filePath.substring(head, tail);

          if (subPath.startsWith("(") && subPath.endsWith(")"))
            subPath = subPath.substring(1, subPath.length() - 1);

          mergePath.addMergePath(VfsOld.lookup(subPath));
        }

        if (tail + 1 == length)
          return mergePath;
        else
          return mergePath.fsWalk(userPath, attributes, filePath.substring(tail + 1));
      }
      else if (ch == ';') {
        String subPath = filePath.substring(head, tail);

        if (subPath.startsWith("(") && subPath.endsWith(")"))
          subPath = subPath.substring(1, subPath.length() - 1);

        mergePath.addMergePath(VfsOld.lookup(subPath));

        head = ++tail;
      }
      else if (ch == '(') {
        int depth = 1;

        for (tail++; tail < length; tail++) {
          if (filePath.charAt(tail) == '(')
            depth++;
          else if (filePath.charAt(tail) == ')') {
            tail++;
            depth--;
            if (depth == 0)
              break;
          }
        }

        if (depth != 0)
          return new NotFoundPath(getSchemeMap(), filePath);
      }
      else
        tail++;
    }

    return new NotFoundPath(getSchemeMap(), filePath);
  }
1075410
protected static String addFileNameToTargetPath(String sourcePath, String targetPath) {
        if (targetPath.endsWith("/")) {
            String filename = Paths.get(sourcePath).getFileName().toString();
            return targetPath + filename;
        }
        return targetPath;
    }