Package org.apache.sling.api.resource

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


    if (queue.isEmpty()) {
      return null;
    }
    if (queue.peekLast().hasNext()) {
      Resource next = queue.peekLast().next();
      queue.add(next.listChildren());
      return next;
    } else {
      queue.pollLast();
      return getElement();
    }
View Full Code Here


        final Resource varClasses = resourceResolver.getResource(VAR_CLASSES);
        final Session session = resourceResolver.adaptTo(Session.class);

        if (varClasses != null) {
            /* /var/classes structure builds out under a UUID that is different between AEM instances */
            final Iterator<Resource> iterator = varClasses.listChildren();

            while (iterator.hasNext()) {
                final Resource varClass = iterator.next();
                final Resource fiddleResource = varClass.getChild(COMPILED_JSP);

View Full Code Here

  public Iterator<Resource> apply(Resource resource) {
    Resource parent = resource.getParent();
    if (parent == null) {
      return new ArrayIterator(resource);
    } else {
      return parent.listChildren();
    }
  }
}
View Full Code Here

      return Collections.emptyList();
    }

    String resourceName = resource.getName();
    List<Resource> prevResources = new ArrayList<Resource>();
    Iterator<Resource> siblings = parent.listChildren();
    while (siblings.hasNext()) {
      Resource sibling = siblings.next();
      if (sibling.getName().equals(resourceName)) {
        break;
      }
View Full Code Here

    String resourceName = resource.getName();
    Resource parent = resource.getParent();
    if (parent == null) {
      return EmptyIterator.INSTANCE;
    }
    Iterator<Resource> siblings = parent.listChildren();
    while (siblings.hasNext()) {
      Resource sibling = siblings.next();
      if (sibling.getName().equals(resourceName)) {
        break;
      }
View Full Code Here

    if (queue.isEmpty()) {
      return null;
    }
    if (queue.peekLast().hasNext()) {
      Resource next = queue.peekLast().next();
      queue.add(next.listChildren());
      return next;
    } else {
      queue.pollLast();
      return getResource();
    }
View Full Code Here

    final String absolutePath = currentExecutionContext.getAbsolutePath(path);
    Resource resource = resourceResolver.getResource(absolutePath);
    if (null == resource) {
      return result;
    }
    for (Iterator<Resource> iterator = resource.listChildren(); iterator.hasNext();) {
      result.add(iterator.next());
    }
    return result;
  }
}
View Full Code Here

    final String absolutePath = currentExecutionContext.getAbsolutePath(path);
    Resource resource = resourceResolver.getResource(absolutePath);
    if (null == resource) {
      return result;
    }
    for (Iterator<Resource> iterator = resource.listChildren(); iterator.hasNext();) {
      result.add(iterator.next());
    }
    return result;
  }
}
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.