Package org.apache.sling.installer.api.tasks

# Interface RegisteredResource

All Known Subinterfaces:
  `Resource`, `TaskResource`

@ProviderType public interface RegisteredResource
A resource that's been registered in the OSGi controller. Data can be either an input stream or a dictionary. Registered resources are processed by a `ResourceTransformer`.

## Method Summary

Modifier and Type
Method
Description
`Dictionary<String,Object>`
`getDictionary()`
Return this resource's dictionary.
`String`
`getDigest()`
Return this resource's digest.
`String`
`getEntityId()`
Return the identifier of the OSGi "entity" that this resource represents, for example "bundle:SID" where SID is the bundle's symbolic ID, or "config:PID" where PID is config's PID.
`InputStream`
`getInputStream()`
Return an input stream with the data of this resource.
`int`
`getPriority()`
Return the priority of this resource.
`String`
`getScheme()`
Return the scheme from where the artifact is originated.
`String`
`getType()`
Return the type of this resource.
`String`
`getURL()`
Return this data's URL.

## Method Details

### getScheme

String getScheme()
Return the scheme from where the artifact is originated.

Returns:
  The scheme.

### getURL

String getURL()
Return this data's URL. The URL is the `getScheme()` followed by a colon, followed by a unique identifier of the resource within the providers space.

Returns:
  The url.

### getType

String getType()
Return the type of this resource.

Returns:
  The resource type.

### getInputStream

InputStream getInputStream() throws IOException
Return an input stream with the data of this resource. Null if resource contains a configuration instead. Caller is responsible for closing the stream. If this resource is of type PROPERTIES it must not return an input stream and if this resource is of type FILE it must return an input stream!

Returns:
  The input stream or `null`.
Throws:
  `IOException` - If an error occurs.

### getDictionary

Dictionary<String,Object> getDictionary()
Return this resource's dictionary. Null if resource contains an InputStream instead. If this resource is of type PROPERTIES it must return a dictionary and if this resource is of type FILE it might return a dictionary!

Returns:
  The resource's dictionary or `null`.

### getDigest

String getDigest()
Return this resource's digest. Not necessarily an actual md5 or other digest of the data, can be any string that changes if the data changes.

Returns:
  The digest.

### getPriority

int getPriority()
Return the priority of this resource. Priorities are used to decide which resource to install when several are registered for the same OSGi entity (bundle, configuration, etc.)

Returns:
  The priority.

### getEntityId

String getEntityId()
Return the identifier of the OSGi "entity" that this resource represents, for example "bundle:SID" where SID is the bundle's symbolic ID, or "config:PID" where PID is config's PID.

Returns:
  The entity id.