01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ResourceWriter.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.resources;
09:
10: import com.uwyn.rife.resources.exceptions.ResourceWriterErrorException;
11:
12: /**
13: * This interface defines the methods that classes with
14: * <code>ResourceWriter</code> functionalities have to implement.
15: * <p>
16: * A <code>ResourceWriter</code> provides an abstract way of modifying
17: * resources. According to a name, a resource and its content can be added,
18: * updated or removed.
19: *
20: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
21: * @version $Revision: 3634 $
22: * @see com.uwyn.rife.resources.ResourceFinder
23: * @since 1.0
24: */
25: public interface ResourceWriter {
26: /**
27: * Adds a resource with the provided name and content.
28: *
29: * @param name the name of the resource
30: * @param content the content of the resource
31: *
32: * @exception ResourceWriterErrorException if an error occurred during the
33: * resource addition.
34: *
35: * @since 1.0
36: */
37: public void addResource(String name, String content)
38: throws ResourceWriterErrorException;
39:
40: /**
41: * Updates the content of the resource with the provided name.
42: *
43: * @param name the name of the resource
44: * @param content the content of the resource
45: *
46: * @exception ResourceWriterErrorException if an error occurred during the
47: * resource update.
48: *
49: * @since 1.0
50: */
51: public boolean updateResource(String name, String content)
52: throws ResourceWriterErrorException;
53:
54: /**
55: * Removes the resource with the provided name.
56: *
57: * @param name the name of the resource
58: *
59: * @exception ResourceWriterErrorException if an error occurred during the
60: * resource removal.
61: *
62: * @since 1.0
63: */
64: public boolean removeResource(String name)
65: throws ResourceWriterErrorException;
66: }
|