dlr 2002/10/10 10:53:33
Modified: src/java/org/apache/velocity/runtime/resource
ContentResource.java
Log:
Changed spurred by Ilkka Priha's <[EMAIL PROTECTED]> patch for "Less
messages from ContentResource":
"The #include directive generates some unnecessary noice when
searching for content via several resource loaders (unlike
#parse). The source seems to be
org.apache.velocity.runtime.resource.ContentResource.java not
catching ResourceNotFoundExceptions."
Ilkka suggested returning false (which is valid), but re-throwing the
ResourceNotFoundException is more in line with what the Template class
does.
Revision Changes Path
1.10 +16 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ContentResource.java
Index: ContentResource.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ContentResource.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- ContentResource.java 10 Oct 2002 17:28:09 -0000 1.9
+++ ContentResource.java 10 Oct 2002 17:53:33 -0000 1.10
@@ -58,6 +58,8 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
+import org.apache.velocity.exception.ResourceNotFoundException;
+
/**
* This class represent a general text resource that may have been
* retrieved from any number of possible sources.
@@ -76,8 +78,14 @@
{
}
- /** Pull in static content and store it */
+ /**
+ * Pull in static content and store it.
+ *
+ * @exception ResourceNotFoundException Resource could not be
+ * found.
+ */
public boolean process()
+ throws ResourceNotFoundException
{
BufferedReader reader = null;
@@ -98,6 +106,12 @@
setData(sw.toString());
return true;
+ }
+ catch ( ResourceNotFoundException e )
+ {
+ // Tell the ContentManager to continue to look through any
+ // remaining configured ResourceLoaders.
+ throw e;
}
catch ( Exception e )
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>