org.apache.jsieve.mailet
Interface ResourceLocator


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:

The advantage of using URIs 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

get

java.io.InputStream get(java.lang.String uri)
                        throws java.io.IOException
GET verb locates and loads a resource.

Parameters:
uri - identifies the Sieve script
Returns:
not null
Throws:
java.io.IOException - when the resource cannot be located


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.