1 /*-- 2 Copyright (C) 2001-2003 Aetrion LLC. 3 All rights reserved. 4 5 Redistribution and use in source and binary forms, with or without 6 modification, are permitted provided that the following conditions 7 are met: 8 9 1. Redistributions of source code must retain the above copyright 10 notice, this list of conditions, and the following disclaimer. 11 12 2. Redistributions in binary form must reproduce the above copyright 13 notice, this list of conditions, and the disclaimer that follows 14 these conditions in the documentation and/or other materials 15 provided with the distribution. 16 3. The name "JPublish" must not be used to endorse or promote products 17 derived from this software without prior written permission. For 18 written permission, please contact info@aetrion.com. 19 20 4. Products derived from this software may not be called "JPublish", nor 21 may "JPublish" appear in their name, without prior written permission 22 from Aetrion LLC (info@aetrion.com). 23 24 In addition, the authors of this software request (but do not require) 25 that you include in the end-user documentation provided with the 26 redistribution and/or in the software itself an acknowledgement equivalent 27 to the following: 28 "This product includes software developed by 29 Aetrion LLC (http://www.aetrion.com/)." 30 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 31 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 32 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 33 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, 34 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 35 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 36 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 39 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 POSSIBILITY OF SUCH DAMAGE. 41 For more information on JPublish, please see <http://www.jpublish.org/>. 42 43 */ 44 package org.jpublish.template; 45 46 import java.io.IOException; 47 48 import org.jpublish.Manager; 49 50 /** 51 * The TemplateManager is a central access point for locating templates. Implementations of the TemplateManager 52 * interface will provide the template loading behavior. 53 * 54 * @author Anthony Eden 55 */ 56 public interface TemplateManager extends Manager { 57 58 /** 59 * Get a Template instance from the given path. If no template can be found then this method must throw an 60 * Exception. 61 * 62 * @param path The template path 63 * @return The Template 64 * @throws IOException Any IOException 65 * @throws TemplateNotFoundException Description of the Exception 66 */ 67 public Template getTemplate(String path) throws IOException, 68 TemplateNotFoundException; 69 70 /** 71 * Get the last modified time of the template with the given path. This method may return -1 if the last modified 72 * time is not known. 73 * 74 * @param path The template path 75 * @return The last modified time 76 * @throws IOException Any IOException 77 */ 78 public long getLastModified(String path) throws IOException; 79 80 } 81 82