Package org.apache.sling.installer.api.info

# Interface Resource

All Superinterfaces:
  `RegisteredResource`

@ProviderType public interface Resource extends RegisteredResource
A resource provides all relevant information about a registered resource.

Since:
  1.0

## Method Summary

Modifier and Type
Method
Description
`@Nullable Object`
`getAttribute(String key)`
Get the value of an attribute.
`@Nullable String`
`getError()`
In case the resource was not successfully processed this might expose the related error description
`long`
`getLastChange()`
When did the last change happen?
`ResourceState`
`getState()`
Get the current state of the resource.
`@Nullable org.osgi.framework.Version`
`getVersion()`
Return the version of the artifact.

### Methods inherited from interface org.apache.sling.installer.api.tasks.RegisteredResource

`getDictionary, getDigest, getEntityId, getInputStream, getPriority, getScheme, getType, getURL`

## Method Details

### getState

ResourceState getState()
Get the current state of the resource.

Returns:
  The resource state.

### getError

@Nullable @Nullable String getError()
In case the resource was not successfully processed this might expose the related error description

Returns:
  an error string or `null`

### getVersion

@Nullable @Nullable org.osgi.framework.Version getVersion()
Return the version of the artifact.

Returns:
  The version of the artifact or `null`

### getLastChange

long getLastChange()
When did the last change happen?

Returns:
  -1 if no change , 0 if unknown, > 0 otherwise

### getAttribute

@Nullable @Nullable Object getAttribute(String key)
Get the value of an attribute. Attributes are specific to the resource and are either set by a `ResourceTransformer` or a `InstallTask` for processing.

Parameters:
  `key` - The name of the attribute
Returns:
  The value of the attribute or `null`