Interface Resource
- All Superinterfaces:
RegisteredResource
A resource provides all relevant information about a registered
resource.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectgetAttribute(String key) Get the value of an attribute.@Nullable StringgetError()In case the resource was not successfully processed this might expose the related error descriptionlongWhen did the last change happen?getState()Get the current state of the resource.@Nullable org.osgi.framework.VersionReturn 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
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
Get the value of an attribute. Attributes are specific to the resource and are either set by aResourceTransformeror aInstallTaskfor processing.- Parameters:
key- The name of the attribute- Returns:
- The value of the attribute or
null
-