org.freecompany.brimstone.core
Interface ResolverService.I2R

All Superinterfaces:
ResolverService
All Known Subinterfaces:
Resolver
All Known Implementing Classes:
DefaultResolver
Enclosing interface:
ResolverService

public static interface ResolverService.I2R
extends ResolverService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.freecompany.brimstone.core.ResolverService
ResolverService.I2C, ResolverService.I2Cs, ResolverService.I2L, ResolverService.I2Ls, ResolverService.I2N, ResolverService.I2Ns, ResolverService.I2R, ResolverService.I2Rs, ResolverService.IeqI
 
Method Summary
 java.lang.Object getResource(java.net.URI uri)
          Retrieve the resource identified by the URI, in its default format.
<T> T
getResource(java.net.URI uri, java.lang.Class<T> cl)
          Retrieve the resource identified by the URI, in a specified format.
 
Methods inherited from interface org.freecompany.brimstone.core.ResolverService
local, resolvable
 

Method Detail

getResource

java.lang.Object getResource(java.net.URI uri)
                             throws URIResolutionException
Retrieve the resource identified by the URI, in its default format.

It's up to the implementation to decide the format in which the resource is returned. Most implementations will return an InputStream with the content of the resource.

Parameters:
uri - the URI to retrieve.
Returns:
the resource identified by the URI.
Throws:
NoSuchURIException - if the URI is definitively known not to represent a resource.
URIGoneException - if the URI existed in the past but nothing is currently known about it.
URINotFoundException - URI exists but there is no available output from this operation.
URIResolutionException - If another problem prevents resolution of the URI.

getResource

<T> T getResource(java.net.URI uri,
                  java.lang.Class<T> cl)
              throws URIResolutionException
Retrieve the resource identified by the URI, in a specified format.

If the service cannot provide the resource as an instance of the requested class, it should return null.

Parameters:
uri - the URI to retrieve.
cl - a Class indicating the type of resource expected.
Returns:
the resource identified by the URI.
Throws:
NoSuchURIException - if the URI is definitively known not to represent a resource.
URIGoneException - if the URI existed in the past but nothing is currently known about it.
URINotFoundException - URI exists but there is no available output from this operation.
URIResolutionException - If another problem prevents resolution of the URI.