All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.jsieve.mailet.ResourceLocator Maven / Gradle / Ivy

Go to download

Apache jSieve is a server side mail filtering system implementing RFC3028. Apache jSieve is developed by the James project.

There is a newer version: 0.5
Show newest version
/****************************************************************
 * Licensed to the Apache Software Foundation (ASF) under one   *
 * or more contributor license agreements.  See the NOTICE file *
 * distributed with this work for additional information        *
 * regarding copyright ownership.  The ASF licenses this file   *
 * to you under the Apache License, Version 2.0 (the            *
 * "License"); you may not use this file except in compliance   *
 * with the License.  You may obtain a copy of the License at   *
 *                                                              *
 *   http://www.apache.org/licenses/LICENSE-2.0                 *
 *                                                              *
 * Unless required by applicable law or agreed to in writing,   *
 * software distributed under the License is distributed on an  *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
 * KIND, either express or implied.  See the License for the    *
 * specific language governing permissions and limitations      *
 * under the License.                                           *
 ****************************************************************/
package org.apache.jsieve.mailet;

import java.io.IOException;
import java.io.InputStream;

/**
 * 

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 sieve scripts - the relative URL scheme * //user@host/sieve will be used to * obtain the script *
*

* 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/[email protected] * when using the file system to store scripts. Note that names MUST * be normalised before resolving on a file system. *

*/ public interface ResourceLocator { /** * GET verb locates and loads a resource. * @param uri identifies the Sieve script * @return not null * @throws IOException when the resource cannot be located */ public InputStream get(String uri) throws IOException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy