Package org.apache.sling.api.resource

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


                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

                            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

            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

                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

                    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

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

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

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

                            // hours
                            final Iterator<Resource> hourIter = dayResource.listChildren();
                            while ( !context.isStopped() && hourIter.hasNext() ) {
                                final Resource hourResource = hourIter.next();
                                final int hour = Integer.valueOf(hourResource.getName());
                                final boolean oldHour = oldDay || hour < removeDate.get(Calendar.HOUR_OF_DAY);
View Full Code Here

                                final Resource hourResource = hourIter.next();
                                final int hour = Integer.valueOf(hourResource.getName());
                                final boolean oldHour = oldDay || hour < removeDate.get(Calendar.HOUR_OF_DAY);

                                // minutes
                                final Iterator<Resource> minuteIter = hourResource.listChildren();
                                while ( !context.isStopped() && minuteIter.hasNext() ) {
                                    final Resource minuteResource = minuteIter.next();

                                    // check if we can delete the minute
                                    final int minute = Integer.valueOf(minuteResource.getName());
View Full Code Here

                                    // check if we can delete the minute
                                    final int minute = Integer.valueOf(minuteResource.getName());
                                    final boolean oldMinute = oldHour || minute <= removeDate.get(Calendar.MINUTE);
                                    if ( oldMinute ) {
                                        final Iterator<Resource> jobIter = minuteResource.listChildren();
                                        while ( !context.isStopped() && jobIter.hasNext() ) {
                                            final Resource jobResource = jobIter.next();
                                            boolean remove = stateList == null;
                                            if ( !remove ) {
                                                final ValueMap vm = ResourceUtil.getValueMap(jobResource);
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.