Package org.apache.sling.resourceresolver.impl.helper

# Class StarResource

java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.api.resource.SyntheticResource
org.apache.sling.resourceresolver.impl.helper.StarResource

All Implemented Interfaces:
  `org.apache.sling.api.adapter.Adaptable`, `org.apache.sling.api.resource.Resource`

@Adaptable(adaptableClass=org.apache.sling.api.resource.Resource.class, adapters=@Adapter(java.lang.String.class)) public class StarResource extends org.apache.sling.api.resource.SyntheticResource
Used to provide the equivalent of an empty Node for GET requests to *.something (SLING-344)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_RESOURCE_TYPE`

### Fields inherited from interface org.apache.sling.api.resource.Resource

`RESOURCE_TYPE_NON_EXISTING`

## Constructor Summary

Constructors
Constructor
Description
`StarResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)`

## Method Summary

Modifier and Type
Method
Description
`<Type> Type`
`adaptTo(Class<Type> type)`
`static boolean`
`appliesTo(String path)`
True if a StarResource should be used for the given request, if a real Resource was not found
`String`
`getResourceSuperType()`
Calls `ResourceUtil.getResourceSuperType(ResourceResolver, String)` method to dynamically resolve the resource super type of this star resource.
`static boolean`
`isStarResource(org.apache.sling.api.resource.Resource res)`
Returns true if the path of the resource ends with the `SLASH_STAR` and therefore should be considered a star resource.

### Methods inherited from class org.apache.sling.api.resource.SyntheticResource

`getPath, getResourceMetadata, getResourceResolver, getResourceType, toString`

### Methods inherited from class org.apache.sling.api.resource.AbstractResource

`getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren`

### Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable

`setAdapterManager, unsetAdapterManager`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### DEFAULT_RESOURCE_TYPE

public static final String DEFAULT_RESOURCE_TYPE

See Also:
  - Constant Field Values

## Constructor Details

### StarResource

public StarResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)

## Method Details

### appliesTo

public static boolean appliesTo(String path)
True if a StarResource should be used for the given request, if a real Resource was not found

Parameters:
  `path` - the path
Returns:
  true if the StarResource should be used, false otherwise

### isStarResource

public static boolean isStarResource(org.apache.sling.api.resource.Resource res)
Returns true if the path of the resource ends with the `SLASH_STAR` and therefore should be considered a star resource.

Parameters:
  `res` - the resource
Returns:
  true if the StarResource should be used, false otherwise

### getResourceSuperType

public String getResourceSuperType()
Calls `ResourceUtil.getResourceSuperType(ResourceResolver, String)` method to dynamically resolve the resource super type of this star resource.

Specified by:
  `getResourceSuperType` in interface `org.apache.sling.api.resource.Resource`
Overrides:
  `getResourceSuperType` in class `org.apache.sling.api.resource.SyntheticResource`
Returns:
  the resource supertype

### adaptTo

public <Type> Type adaptTo(Class<Type> type)

Specified by:
  `adaptTo` in interface `org.apache.sling.api.adapter.Adaptable`
Overrides:
  `adaptTo` in class `org.apache.sling.api.adapter.SlingAdaptable`