Examples of listChildren()


Examples of org.apache.sling.api.resource.Resource.listChildren()

    }

    private void getChildrenData(CassandraResourceProvider cassandraResourceProvider, String cf) {
        Resource resource = cassandraResourceProvider.getResource(new CassandraResourceResolver(), "/content/cassandra/" + cf + "/c1");
        Assert.assertNotNull(resource);
        Iterator<Resource> children = resource.listChildren();
        boolean hasChild = false;
        while(children.hasNext()){
            Resource r = children.next();
            if(r.getPath().equals("/content/cassandra/" + cf + "/c1/c2")) {
            Assert.assertNotNull(r);
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

        Iterator<Tenant> result = call(new ResourceResolverTask<Iterator<Tenant>>() {
            public Iterator<Tenant> call(ResourceResolver resolver) {
                Resource tenantRootRes = resolver.getResource(tenantRootPath);

                List<Tenant> tenantList = new ArrayList<Tenant>();
                Iterator<Resource> tenantResourceList = tenantRootRes.listChildren();
                while (tenantResourceList.hasNext()) {
                    Resource tenantRes = tenantResourceList.next();

                    if (filter == null || filter.matches(ResourceUtil.getValueMap(tenantRes))) {
                        TenantImpl tenant = new TenantImpl(tenantRes);
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

        for(final String path : this.searchPaths ) {
            // check if the search path exists
            final Resource spResource = this.resourceResolver.getResource(path.substring(0, path.length() - 1));
            if ( spResource != null ) {
                // now iterate over the child nodes
                final Iterator<Resource> spIter = spResource.listChildren();
                while ( spIter.hasNext() ) {
                    // check if the node has a rewriter config
                    final Resource appResource = spIter.next();
                    final Resource parentResource = this.resourceResolver.getResource(appResource.getPath() + CONFIG_PATH);
                    if ( parentResource != null ) {
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

                    // check if the node has a rewriter config
                    final Resource appResource = spIter.next();
                    final Resource parentResource = this.resourceResolver.getResource(appResource.getPath() + CONFIG_PATH);
                    if ( parentResource != null ) {
                        // now read configs
                        final Iterator<Resource> iter = parentResource.listChildren();
                        while ( iter.hasNext() ) {
                            final Resource configResource = iter.next();
                            final String key = configResource.getName();
                            final ProcessorConfigurationImpl config = this.getProcessorConfiguration(configResource);
                            this.log.debug("Found new processor configuration {}", config);
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

    /** ResourceProvider interface */
    public Iterator<Resource> listChildren(Resource parent) {
      ResourceResolver resourceResolver = parent.getResourceResolver();
      Resource resource = resourceResolver.resolve("/");
      return resource.listChildren();
    }
   
}
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

                final Resource jobsRoot = resolver.getResource(this.configuration.getAssginedJobsPath());
                this.logger.debug("Got jobs root {}", jobsRoot);

                // this resource should exist, but we check anyway
                if ( jobsRoot != null ) {
                    final Iterator<Resource> instanceIter = jobsRoot.listChildren();
                    while ( caps.isActive() && instanceIter.hasNext() ) {
                        final Resource instanceResource = instanceIter.next();

                        final String instanceId = instanceResource.getName();
                        if ( !caps.isActive(instanceId) ) {
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

                            break;
                        }
                    }
                    final boolean supportsBridged = flag;

                    final Iterator<Resource> topicIter = jobsRoot.listChildren();
                    while ( caps.isActive() && topicIter.hasNext() ) {
                        final Resource topicResource = topicIter.next();

                        final String topicName = topicResource.getName().replace('.', '/');
                        this.logger.debug("Checking topic {}..." , topicName);
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

            final List<String> stateList)
    throws PersistenceException {
        final Resource baseResource = resolver.getResource(basePath);
        // sanity check - should never be null
        if ( baseResource != null ) {
            final Iterator<Resource> topicIter = baseResource.listChildren();
            while ( !context.isStopped() && topicIter.hasNext() ) {
                final Resource topicResource = topicIter.next();

                // check topic
                boolean found = topics == null;
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

                if ( !found ) {
                    continue;
                }

                // now years
                final Iterator<Resource> yearIter = topicResource.listChildren();
                while ( !context.isStopped() && yearIter.hasNext() ) {
                    final Resource yearResource = yearIter.next();
                    final int year = Integer.valueOf(yearResource.getName());
                    final boolean oldYear = year < removeDate.get(Calendar.YEAR);
View Full Code Here

Examples of org.apache.sling.api.resource.Resource.listChildren()

                    final Resource yearResource = yearIter.next();
                    final int year = Integer.valueOf(yearResource.getName());
                    final boolean oldYear = year < removeDate.get(Calendar.YEAR);

                    // months
                    final Iterator<Resource> monthIter = yearResource.listChildren();
                    while ( !context.isStopped() && monthIter.hasNext() ) {
                        final Resource monthResource = monthIter.next();
                        final int month = Integer.valueOf(monthResource.getName());
                        final boolean oldMonth = oldYear || month < (removeDate.get(Calendar.MONTH) + 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.