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

All Known Subinterfaces:
Resource, 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
 java.util.Dictionary<java.lang.String,java.lang.Object> getDictionary()
          Return this resource's dictionary.
 java.lang.String getDigest()
          Return this resource's digest.
 java.lang.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.
 java.io.InputStream getInputStream()
          Return an input stream with the data of this resource.
 int getPriority()
          Return the priority of this resource.
 java.lang.String getScheme()
          Return the scheme from where the artifact is originated.
 java.lang.String getType()
          Return the type of this resource.
 java.lang.String getURL()
          Return this data's URL.
 

Method Detail

getScheme

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


getURL

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

java.lang.String getType()
Return the type of this resource.

Returns:
The resource type.

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.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:
java.io.IOException

getDictionary

java.util.Dictionary<java.lang.String,java.lang.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

java.lang.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, configuration, etc.)


getEntityId

java.lang.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-2012 The Apache Software Foundation. All Rights Reserved.