KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > util > ResourceHandler


1 package org.sapia.soto.util;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5
6
7 /**
8  * Specifies the behavior of classes used to resolve resources.
9  *
10  * @author Yanick Duchesne
11  * <dl>
12  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public interface ResourceHandler {
18   /**
19    * Returns the stream corresponding to the given URI.
20    *
21    * @param uri a URI.
22    * @return an <code>InputStream</code>.
23    * @throws IOException if a problem occurs.
24    */

25   public InputStream JavaDoc getResource(String JavaDoc uri) throws IOException JavaDoc;
26
27   /**
28    * Returns the resource object corresponding to the given URI.
29    *
30    * @param uri a URI.
31    * @return a <code>Resource</code>.
32    * @throws IOException if a problem occurs.
33    */

34   public Resource getResourceObject(String JavaDoc uri) throws IOException JavaDoc;
35
36     /**
37      * Returns <code>true</code> if this handler "recognizes" resources with
38      * the given URI. This methods is used to hold resource handlers in a chain
39      * of responsability.
40      *
41      * @param uri a URI.
42      * @return <code>true</code> if this handler can handle resources with the
43      * given URI.
44      */

45   public boolean accepts(String JavaDoc uri);
46   
47 }
48
Popular Tags