Class PlanetsResourceProvider
java.lang.Object
org.apache.sling.spi.resource.provider.ResourceProvider<PlanetsResourceProvider.DoesNotNeedAContext>
org.apache.sling.launchpad.testservices.resourceprovider.PlanetsResourceProvider
public class PlanetsResourceProvider
extends org.apache.sling.spi.resource.provider.ResourceProvider<PlanetsResourceProvider.DoesNotNeedAContext>
Test/example ResourceProvider that provides info about
the Solar System's planets at /planets.
Use /planets.tidy.-1.json to GET the whole thing.
This uses the new (February 2016) spi.ResourceProvider base class.
If you need an example based on the old ResourceProvider interface,
see this code at svn revision 1727946.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
If this provider required a context this would be more elaborate, but for this simple example we don't need one. -
Field Summary
FieldsFields inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
AUTH_ADMIN, AUTH_CLONE, AUTH_SERVICE_BUNDLE, AUTHENTICATE_LAZY, AUTHENTICATE_NO, AUTHENTICATE_REQUIRED, MODE_OVERLAY, MODE_PASSTHROUGH, PROPERTY_ADAPTABLE, PROPERTY_ATTRIBUTABLE, PROPERTY_AUTHENTICATE, PROPERTY_MODE, PROPERTY_MODIFIABLE, PROPERTY_NAME, PROPERTY_REFRESHABLE, PROPERTY_ROOT, PROPERTY_USE_RESOURCE_ACCESS_SECURITY, RESOURCE_TYPE_SYNTHETIC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sling.api.resource.Resource
getResource
(org.apache.sling.spi.resource.provider.ResolveContext<PlanetsResourceProvider.DoesNotNeedAContext> ctx, String path, org.apache.sling.spi.resource.provider.ResourceContext resourceContext, org.apache.sling.api.resource.Resource parent) Iterator<org.apache.sling.api.resource.Resource>
listChildren
(org.apache.sling.spi.resource.provider.ResolveContext<PlanetsResourceProvider.DoesNotNeedAContext> ctx, org.apache.sling.api.resource.Resource parent) Methods inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
adaptTo, authenticate, commit, copy, create, delete, getAttribute, getAttributeNames, getParent, getProviderContext, getQueryLanguageProvider, hasChanges, isLive, logout, move, orderBefore, refresh, revert, start, stop, update
-
Field Details
-
ROOT
This can be configurable of course- See Also:
-
-
Constructor Details
-
PlanetsResourceProvider
public PlanetsResourceProvider()
-
-
Method Details
-
getResource
public org.apache.sling.api.resource.Resource getResource(org.apache.sling.spi.resource.provider.ResolveContext<PlanetsResourceProvider.DoesNotNeedAContext> ctx, String path, org.apache.sling.spi.resource.provider.ResourceContext resourceContext, org.apache.sling.api.resource.Resource parent) - Specified by:
getResource
in classorg.apache.sling.spi.resource.provider.ResourceProvider<PlanetsResourceProvider.DoesNotNeedAContext>
-
listChildren
public Iterator<org.apache.sling.api.resource.Resource> listChildren(org.apache.sling.spi.resource.provider.ResolveContext<PlanetsResourceProvider.DoesNotNeedAContext> ctx, org.apache.sling.api.resource.Resource parent) - Specified by:
listChildren
in classorg.apache.sling.spi.resource.provider.ResourceProvider<PlanetsResourceProvider.DoesNotNeedAContext>
-