public class ResourceTraversor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ResourceTraversor.Entry |
Constructor and Description |
---|
ResourceTraversor(int levels,
long maxResources,
org.apache.sling.api.resource.Resource resource,
boolean tidy)
Create a ResourceTraversor, optionally limiting recursion and total number of resources
|
Modifier and Type | Method and Description |
---|---|
int |
collectResources()
Recursive descent from startResource, collecting JSONObjects into
startObject.
|
long |
getCount() |
JSONObject |
getJSONObject() |
public ResourceTraversor(int levels, long maxResources, org.apache.sling.api.resource.Resource resource, boolean tidy) throws JSONException
levels
- recursion levels limit, -1 means no limitmaxResources
- maximum number of resources to collect, ignored if levels == 1resource
- the root resource to traversetidy
- not usedJSONException
public int collectResources() throws org.apache.sling.api.request.RecursionTooDeepException, JSONException
JSONException
org.apache.sling.api.request.RecursionTooDeepException
public long getCount()
public JSONObject getJSONObject()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.