Ilkka Priha wrote:
> 
> JarResourceLoader reads its paths from a property named "resource.path",
> which expands to "jar.resource.loader.resource.path". Documentation states
> that paths should be defined with "jar.resource.loader.path" like with
> FileResourceLoader. It would be good to have a constant
> JAR_RESOURCE_LOADER_PATH, which could be referred to from Turbine also as it
> needs to redefine local jar paths to be relative to the servlet context. A
> constant makes such modifications more reliable (the
> FILE_RESOURCE_LOADER_PATH is already used for the corresponding file path
> modification).

Ya, this should be fixed.  Ug.  It's easy to do - make it like
FileResourceLoader - but who breaks?  Anyone?

I have to admit that I am not a big fan of the loader-specific
constants, because it seems to be to be in conflict with the rather nice
and flexible mechanism for setting things up.  The following is
perfectly valid :

 Velocity.setProperty("resource.loader", "ilkka");
 Velocity.setProperty("ilkka.resource.loader.class",
".....JarResourceLoader");
 Velocity.setProperty("ilkka.resource.loader.path", "....");

  etc

Maybe things like RESOURCE_LOADER, CLASS, PATH should be defined, and
maybe something like

Resource.RESOURCE_LOADER
Resource.RESOURCE_LOADER_CLASS
Resource.RESOURCE_LOADER_PATH

just to stop piling on in RuntimeConstants

 Velocity.setProperty( Resource.RESOURCE_LOADER, "ilkka");
 Velocity.setProperty("ilkka" + Resource.RESOURCE_LOADER_CLASS,
".....JarResourceLoader");
 Velocity.setProperty("ilkka" + Resource.RESOURCE_LOADER_PATH, "....");

I dunno :)  The FILE_RESOURCE_LOADER_PATH is a constant because the
FileResourceLoader is thedefault, I suppose.

geir

 
> -- Ilkka
> 
>     public void init(Configuration configuration)
>     {
>         Vector paths = configuration.getVector("resource.path");
>         Runtime.info("PATHS SIZE= " + paths.size() );
> 
>         for ( int i=0; i<paths.size(); i++ )
>         {
>             loadJar( (String)paths.get(i) );
>         }
> 
>         Runtime.info("JarResourceLoader initialized...");
>     }

-- 
Geir Magnusson Jr.                           [EMAIL PROTECTED]
System and Software Consulting

Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to