|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceLocator
Experimental API locates resources. Used to load Sieve scripts. The base for relative URLs should be taken to be the root of the James configuration.
Required schemas:
//user@host/sieve will be used to
obtain the script
The advantage of using URI
s
and verbs (for example GET
, POST
)
are their uniformity. The same API can be used to interface radically
different resource types and protocols. This allows concise, minimal,
powerful APIs to be created. Their simplicity is easy to preserved
across versions.
The disadvantage is that this free decouple means that there is no gaurantee that the implementations decoupled by this interface actually support the same scheme. Issues will be caught only at deployment and not at compile time. This places a larger burden on the deployer.
Either an understanding or a consistent URL mapping scheme may be
required. For example, //john.smith@localhost/sieve
may need to be resolved to ../apps/james/var/sieve/john.smith@localhost.sieve
when using the file system to store scripts. Note that names MUST
be normalised before resolving on a file system.
Method Summary | |
---|---|
java.io.InputStream |
get(java.lang.String uri)
GET verb locates and loads a resource. |
Method Detail |
---|
java.io.InputStream get(java.lang.String uri) throws java.io.IOException
uri
- identifies the Sieve script
java.io.IOException
- when the resource cannot be located
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |