Examples of listChildren()


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 < now.get(Calendar.YEAR);

                        // months
                        final Iterator<Resource> monthIter = yearResource.listChildren();
                        while ( caps.isActive() && monthIter.hasNext() ) {
                            final Resource monthResource = monthIter.next();
                            final int month = Integer.valueOf(monthResource.getName());
                            final boolean oldMonth = oldYear || month < (now.get(Calendar.MONTH) + 1);
View Full Code Here

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

                            final Resource monthResource = monthIter.next();
                            final int month = Integer.valueOf(monthResource.getName());
                            final boolean oldMonth = oldYear || month < (now.get(Calendar.MONTH) + 1);

                            // days
                            final Iterator<Resource> dayIter = monthResource.listChildren();
                            while ( caps.isActive() && dayIter.hasNext() ) {
                                final Resource dayResource = dayIter.next();
                                final int day = Integer.valueOf(dayResource.getName());
                                final boolean oldDay = oldMonth || day < now.get(Calendar.DAY_OF_MONTH);
View Full Code Here

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

                                final Resource dayResource = dayIter.next();
                                final int day = Integer.valueOf(dayResource.getName());
                                final boolean oldDay = oldMonth || day < now.get(Calendar.DAY_OF_MONTH);

                                // hours
                                final Iterator<Resource> hourIter = dayResource.listChildren();
                                while ( caps.isActive() && hourIter.hasNext() ) {
                                    final Resource hourResource = hourIter.next();
                                    final int hour = Integer.valueOf(hourResource.getName());
                                    final boolean oldHour = (oldDay && (oldMonth || now.get(Calendar.HOUR_OF_DAY) > 0)) || hour < (now.get(Calendar.HOUR_OF_DAY) -1);
View Full Code Here

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

                                    final int hour = Integer.valueOf(hourResource.getName());
                                    final boolean oldHour = (oldDay && (oldMonth || now.get(Calendar.HOUR_OF_DAY) > 0)) || hour < (now.get(Calendar.HOUR_OF_DAY) -1);

                                    // we only remove minutes if the hour is old
                                    if ( oldHour ) {
                                        final Iterator<Resource> minuteIter = hourResource.listChildren();
                                        while ( caps.isActive() && minuteIter.hasNext() ) {
                                            final Resource minuteResource = minuteIter.next();

                                            // check if we can delete the minute
                                            if ( !minuteResource.listChildren().hasNext() ) {
View Full Code Here

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

                                        final Iterator<Resource> minuteIter = hourResource.listChildren();
                                        while ( caps.isActive() && minuteIter.hasNext() ) {
                                            final Resource minuteResource = minuteIter.next();

                                            // check if we can delete the minute
                                            if ( !minuteResource.listChildren().hasNext() ) {
                                                resolver.delete(minuteResource);
                                                resolver.commit();
                                            }
                                        }
                                    }
View Full Code Here

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

        try {
            final Resource baseResource = resolver.getResource(this.configuration.getLocalJobsPath());

            // sanity check - should never be null
            if ( baseResource != null ) {
                final Iterator<Resource> topicIter = baseResource.listChildren();
                while ( topicIter.hasNext() ) {
                    final Resource topicResource = topicIter.next();
                    final String topic = topicResource.getName().replace('.', '/');
                    logger.debug("Found topic {}", topic);
                    topics.add(topic);
View Full Code Here

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

                Type type = Type.getType(propertyValueMap.get(Constants.PROPERTY_TYPE, String.class));
                Boolean propertyMultiple = PropertiesUtil.toBoolean(propertyValueMap.get(Constants.PROPERTY_MULTIPLE), false);
                Resource validators = property.getChild(Constants.VALIDATORS);
                Map<Validator, Map<String, String>> validatorsMap = new HashMap<Validator, Map<String, String>>();
                if (validators != null) {
                    Iterator<Resource> validatorsIterator = validators.listChildren();
                    while (validatorsIterator.hasNext()) {
                        Resource validator = validatorsIterator.next();
                        ValueMap validatorProperties = validator.adaptTo(ValueMap.class);
                        String validatorName = validator.getName();
                        Validator v = vls.getValidator(validatorName);
View Full Code Here

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

     * @see ResourceProvider#listChildren(Resource)
     */
    public Iterator<Resource> listChildren(final ResourceResolverContext ctx, final Resource parent) {
        final ResourceProvider rp = this.getResourceProvider(ctx);
        if ( rp != null ) {
            return getReadableChildrenIterator( ctx, rp.listChildren(parent) );
        }
        return null;
    }

    /**
 
View Full Code Here

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

        do {
            selector = (selIdx < numRequestSelectors)
                    ? requestSelectors[selIdx]
                    : null;

            Iterator<Resource> children = resolver.listChildren(current);
            while (children.hasNext()) {
                Resource child = children.next();

                if (!this.isPathAllowed(child.getPath())) {
                    continue;
View Full Code Here

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

            name = this.scriptName;
        } else {
            current = getResource(resolver, location.getPath() + '/' + this.scriptName.substring(0, pos));
            name = this.scriptName.substring(pos + 1);
        }
        final Iterator<Resource> children = resolver.listChildren(current);
        while (children.hasNext()) {
            final Resource child = children.next();

            if ( !this.isPathAllowed(child.getPath()) ) {
                continue;
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.