org.apache.sling.installer.api.tasks
Interface RegisteredResource

All Known Subinterfaces:
TaskResource

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
 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 orginated.
 String getType()
          Return the type of this resource.
 String getURL()
          Return this data's url.
 

Method Detail

getScheme

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


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..


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

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.


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, config, etc.)


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.



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.