jvanzyl 01/03/22 20:18:50
Modified: src/java/org/apache/velocity/runtime/resource
ResourceManager.java
src/java/org/apache/velocity/runtime/resource/loader
FileResourceLoader.java JarResourceLoader.java
Log:
- correcting some docs
- cleaning up some formatting
- no functional changes
Revision Changes Path
1.21 +29 -11
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java
Index: ResourceManager.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ResourceManager.java 2001/03/22 15:55:37 1.20
+++ ResourceManager.java 2001/03/23 04:18:50 1.21
@@ -78,7 +78,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paulo Gaspar</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: ResourceManager.java,v 1.20 2001/03/22 15:55:37 geirm Exp $
+ * @version $Id: ResourceManager.java,v 1.21 2001/03/23 04:18:50 jvanzyl Exp $
*/
public class ResourceManager
{
@@ -105,12 +105,12 @@
private static ArrayList resourceLoaders = new ArrayList();
/**
- * This is a list of the template stream source
+ * This is a list of the template input stream source
* initializers, basically properties for a particular
* template stream source. The order in this list
* reflects numbering of the properties i.e.
- * template.loader.1.<property> = <value>
- * template.loader.2.<property> = <value>
+ *
+ * <loader-id>.resource.loader.<property> = <value>
*/
private static ArrayList sourceInitializerList = new ArrayList();
@@ -272,17 +272,23 @@
}
catch( ResourceNotFoundException rnfe )
{
- Runtime.error("ResourceManager.getResource() exception: " +
rnfe);
+ Runtime.error(
+ "ResourceManager.getResource() exception: " + rnfe);
+
throw rnfe;
}
catch( ParseErrorException pee )
{
- Runtime.error("ResourceManager.getResource() exception: " +
pee);
+ Runtime.error(
+ "ResourceManager.getResource() exception: " + pee);
+
throw pee;
}
catch( Exception eee )
{
- Runtime.error("ResourceManager.getResource() exception: " +
eee);
+ Runtime.error(
+ "ResourceManager.getResource() exception: " + eee);
+
throw eee;
}
}
@@ -357,7 +363,10 @@
* Return null if we can't find a resource.
*/
if (resource.getData() == null)
- throw new ResourceNotFoundException("Unable to find resource '"
+ resourceName + "'");
+ {
+ throw new ResourceNotFoundException(
+ "Unable to find resource '" + resourceName + "'");
+ }
resource.setLastModified( howOldItWas );
@@ -372,21 +381,30 @@
*/
if (resourceLoader.isCachingOn())
+ {
globalCache.put(resourceName, resource);
+ }
}
catch( ResourceNotFoundException rnfe2 )
{
- Runtime.error("ResourceManager : unable to find resource '" +
resourceName + "' in any resource loader.");
+ Runtime.error(
+ "ResourceManager : unable to find resource '" + resourceName +
+ "' in any resource loader.");
+
throw rnfe2;
}
catch( ParseErrorException pee )
{
- Runtime.error("ResourceManager.getResource() parse exception: " +
pee);
+ Runtime.error(
+ "ResourceManager.getResource() parse exception: " + pee);
+
throw pee;
}
catch( Exception ee )
{
- Runtime.error("ResourceManager.getResource() exception: " + ee);
+ Runtime.error(
+ "ResourceManager.getResource() exception: " + ee);
+
throw ee;
}
}
1.11 +1 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java
Index: FileResourceLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FileResourceLoader.java 2001/03/20 17:28:35 1.10
+++ FileResourceLoader.java 2001/03/23 04:18:50 1.11
@@ -77,7 +77,7 @@
* That'll change once we decide how we want to do configuration
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: FileResourceLoader.java,v 1.10 2001/03/20 17:28:35 geirm Exp $
+ * @version $Id: FileResourceLoader.java,v 1.11 2001/03/23 04:18:50 jvanzyl Exp $
*/
public class FileResourceLoader extends ResourceLoader
{
@@ -203,7 +203,6 @@
*/
private InputStream findTemplate(String path, String template)
{
-
try
{
File file = new File( path, template );
1.8 +3 -2
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
Index: JarResourceLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JarResourceLoader.java 2001/03/20 00:55:04 1.7
+++ JarResourceLoader.java 2001/03/23 04:18:50 1.8
@@ -80,7 +80,7 @@
* ResourceLoader to load templates from multiple Jar files.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
- * @version $Id: JarResourceLoader.java,v 1.7 2001/03/20 00:55:04 jon Exp $
+ * @version $Id: JarResourceLoader.java,v 1.8 2001/03/23 04:18:50 jvanzyl Exp $
*/
public class JarResourceLoader extends ResourceLoader
{
@@ -124,7 +124,8 @@
}
if ( !path.startsWith("jar:") )
{
- Runtime.error("JAR path must start with jar: -> see
java.net.JarURLConnection for information");
+ Runtime.error("JAR path must start with jar: -> " +
+ "see java.net.JarURLConnection for information");
}
if ( !path.endsWith("!/") )
{