Searches access list for the given node.

@param acm access manager
@param path the path to the node
@return access list representation.
@throws RepositoryException
357295
private AccessControlList findAccessList( AccessControlManager acm,
                                              String path ) throws RepositoryException {
        AccessControlPolicy[] policy = acm.getPolicies(path);

        if (policy != null && policy.length > 0) {
            return (AccessControlList)policy[0];
        }

        policy = acm.getEffectivePolicies(path);
        if (policy != null && policy.length > 0) {
            return (AccessControlList)policy[0];
        }

        return null;
    }
135944
@Override
    public Enumeration<URL> getResources(final String path) throws IOException {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResources(path);
        } else {
            return new Enumeration<URL>() {
                /** The idx. */
                int idx;

                @Override
                public boolean hasMoreElements() {
                    return idx < resourceList.size();
                }

                @Override
                public URL nextElement() {
                    return resourceList.get(idx++).getURL();
                }
            };
        }
    }
1298623
@Override
	protected File[] listRepositoryFiles() {
		FileFilter textLogFilter = new FileFilter() {
			@Override
			public boolean accept(File pathname) {
				return pathname.getName().startsWith(TEXTLOGPREF) && pathname.getName().endsWith(TEXTLOGEXT);
			}
		};
		return AccessHelper.listFiles(repositoryLocation, textLogFilter);
	}
388642
public Object visit(QueryRootNode node, Object data) throws RepositoryException {
        StringBuilder sb = (StringBuilder) data;
        node.getLocationNode().accept(this, data);
        InternalQName[] selectProps = node.getSelectProperties();
        if (selectProps.length > 0) {
            sb.append('/');
            boolean union = selectProps.length > 1;
            if (union) {
                sb.append('(');
            }
            String pipe = "";
            for (int i = 0; i < selectProps.length; i++) {
                try {
                    sb.append(pipe);
                    sb.append('@');
                    sb.append(resolver.createJCRName(encode(selectProps[i])).getAsString());
                    pipe = "|";
                } catch (NamespaceException e) {
                    exceptions.add(e);
                }
            }
            if (union) {
                sb.append(')');
            }
        }
        if (node.getOrderNode() != null) {
            node.getOrderNode().accept(this, data);
        }
        return data;
    }
824083
public static void xmlAttributeExistent(String path, Attribute attribute, Class<?> aClass){
		throw new XmlMappingAttributeExistException (MSG.INSTANCE.message(xmlMappingAttributeExistException2,attribute.getName(),aClass.getSimpleName(),path));
	}
331159
public Object visit(QueryRootNode node, Object data) throws RepositoryException
   {
      BooleanQuery root = new BooleanQuery();

      Query wrapped = root;
      if (node.getLocationNode() != null)
      {
         wrapped = (Query)node.getLocationNode().accept(this, root);
      }

      return wrapped;
   }
187947
private void checkGroup(final SessionProvider sessionProvider, final String groupPath) throws RepositoryException
   {
      String[] groupNames = groupPath.split("/");
      String prefix = "/" + EXO_REGISTRY;
      Session session = session(sessionProvider, repositoryService.getCurrentRepository());
      for (String name : groupNames)
      {
         String path = prefix + "/" + name;
         try
         {
            Node group = (Node)session.getItem(path);
            if (!group.isNodeType(EXO_REGISTRYGROUP_NT))
               throw new RepositoryException("Node at " + path + " should be  " + EXO_REGISTRYGROUP_NT + " type");
         }
         catch (PathNotFoundException e)
         {
            Node parent = (Node)session.getItem(prefix);
            parent.addNode(name, EXO_REGISTRYGROUP_NT);
            parent.save();
         }
         prefix = path;
      }
   }
124325
protected List<String> getRoles(String path) {
        List<String> defaultRoles = new ArrayList<String>();
        defaultRoles.add(Workgroup.SITE_ADMIN_GROUP);
        return defaultRoles;
    }
995847
private Set<Resource<T>> listStackDirectory(Path path) {
        HashSet<Resource<T>> merge = new HashSet<Resource<T>>();
        if (treeHandlerList.size() > 0) {
            for (SelectiveTree<T> treeHandler : treeHandlerList) {
                if (PathUtil.hasRoot(treeHandler.getSubPath(), path) && !PathUtil.equals(
                    treeHandler.getSubPath(),
                    path
                )) {
                    String relativePath = PathUtil.removePrefix(path.getPath(), treeHandler.getSubPath().getPath());
                    String[] components = PathUtil.componentsFromPathString(relativePath);
                    Path subpath = PathUtil.appendPath(path, components[0]);
                    merge.add(new ResourceBase<T>(subpath, null, true));
                }
            }
        }
        return merge;
    }
913040
public List<Descriptor> getDescriptors(SessionProvider sp, FolderDescriptor parentFolder) throws RepositoryException
   {
      LOG.info("Get child nodes to : " + parentFolder.getAsString());

      Session session = currentSession(sp);

      session.refresh(true);

      Node rootNode = (Node) session.getItem(rootNodePath);
      String strPath = parentFolder.getAsString();

      Node targetNode;
      if (strPath.equals("/"))
      {
         targetNode = rootNode;
      }
      else
      {
         targetNode = rootNode.getNode(strPath.substring(1));
      }
      LOG.info(targetNode.getPath());
      NodeType[] a = targetNode.getMixinNodeTypes();
      StringBuilder mixins = new StringBuilder();
      for (NodeType type : a)
      {
         mixins.append(type.getName()).append(" ");
      }
      LOG.info("**** Mixins : " + mixins.toString());

      LOG.info("**** Workspace : " + session.getWorkspace().getName());

      List<Descriptor> childNodes = new ArrayList<Descriptor>();
      for (NodeIterator iterator = targetNode.getNodes(); iterator.hasNext();)
      {
         // descriptor holds names of all child nodes than makes up artifact
         // coordinates.
         Node node = iterator.nextNode();

         if (node.isNodeType("nt:folder") || node.isNodeType("nt:file"))
         {
            Descriptor descriptor = new FolderDescriptor(node.getName());
            childNodes.add(descriptor);
         }
      }

      return (childNodes.size() == 0) ? null : childNodes;
   }
643217
public Authorizable getOrCreateUser(JackrabbitSession session, UserManager userManager,
                                        String path, boolean systemUser)
            throws RepositoryException {
        String[] pathAndName = pathAndName(path);
        Authorizable user = userManager.getAuthorizable(pathAndName[1]);
        LOG.debug("user.check: " + pathAndName[1] + " - " + user);
        if (user == null) {
            LOG.info("user.create: " + pathAndName[1]);
            Principal principal = new NamePrincipal(pathAndName[1]);
            if (systemUser) {
                try {
                    // using reflection to create systems users for compatibility to older API versions
                    Method createSystemUser = userManager.getClass().getMethod("createSystemUser", String.class, String.class);
                    user = (User) createSystemUser.invoke(userManager, pathAndName[1], pathAndName[0]);
                } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
                    LOG.error(ex.toString());
                }
            } else {
                user = userManager.createUser(pathAndName[1], pathAndName[1],
                        principal, pathAndName[0]);
            }
        }
        return user;
    }
735547
public List<DbxEntry.File> getRevisions(String path)
        throws DbxException
    {
        DbxPathV1.checkArgNonRoot("path", path);

        String apiPath = "1/revisions/auto" + path;

        return doGet(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler<List<DbxEntry.File>>() {
            public List<DbxEntry.File> handle(HttpRequestor.Response response)
                throws DbxException
            {
                if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
                Collector<DbxEntry./*@Nullable*/File,ArrayList<DbxEntry.File>> collector =
                    Collector.NullSkipper.<DbxEntry.File,ArrayList<DbxEntry.File>>mk(new Collector.ArrayListCollector<DbxEntry.File>());
                return DbxRequestUtil.readJsonFromResponse(JsonArrayReader.mk(DbxEntry.File.ReaderMaybeDeleted, collector), response);
            }
        });
    }
36790
public void setACL(final String path, List<ACL> acl, int version,
            StatCallback cb, Object ctx) {
        verbotenThreadCheck();
        final String clientPath = path;
        PathUtils.validatePath(clientPath);

        final String serverPath = prependChroot(clientPath);

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.setACL);
        SetACLRequest request = new SetACLRequest();
        request.setPath(serverPath);
        request.setAcl(acl);
        request.setVersion(version);
        SetACLResponse response = new SetACLResponse();
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
                clientPath, serverPath, ctx, null);
    }
78272
Path absolutePathFor( String absPath ) throws RepositoryException {
        Path path = null;
        try {
            path = pathFactory().create(absPath);
        } catch (org.modeshape.jcr.value.ValueFormatException e) {
            throw new RepositoryException(e.getMessage());
        }
        if (!path.isAbsolute()) {
            throw new RepositoryException(JcrI18n.invalidAbsolutePath.text(absPath));
        }
        return path;
    }
823230
@Override
	public Acl getAcl(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension) {
		return aclService.getAcl(repositoryId, objectId, onlyBasicPermissions, extension);
	}
1261554
@SuppressWarnings("null")
  private NodeIterator searchNodesByTemplate(String[] templates, String rootPath, SlingHttpServletRequest request) throws RepositoryException {
    String queryString = "/jcr:root" + ISO9075.encodePath(rootPath) + "//*"
        + "[@cq:template='" + StringUtils.join(escapeXPathQueryExpressions(templates), "' or @cq:template='") + "']";
    QueryManager queryManager = request.getResourceResolver().adaptTo(Session.class).getWorkspace().getQueryManager();
    @SuppressWarnings("deprecation")
    Query query = queryManager.createQuery(queryString, Query.XPATH);
    QueryResult result = query.execute();
    return result.getNodes();
  }
734560
@Programmatic
    public ApplicationTenancy findByPathCached(final String path) {
        return queryResultsCache.execute(new Callable<ApplicationTenancy>() {
            @Override
            public ApplicationTenancy call() throws Exception {
                return findByPath(path);
            }
        }, ApplicationTenancyRepository.class, "findByPathCached", path);
    }