dlr         02/02/11 17:47:38

  Modified:    src/java/org/apache/velocity/runtime/resource/loader
                        PathMapAdapter.java
  Log:
  Added "separator" String instance member for consistant use
  throughout.
  
  Revision  Changes    Path
  1.4       +9 -3      
jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/PathMapAdapter.java
  
  Index: PathMapAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/loader/PathMapAdapter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- PathMapAdapter.java       12 Feb 2002 01:40:10 -0000      1.3
  +++ PathMapAdapter.java       12 Feb 2002 01:47:38 -0000      1.4
  @@ -76,6 +76,11 @@
   public class PathMapAdapter extends LoaderAdapter
   {
       /**
  +     * The file separator to use when creating paths.
  +     */
  +    protected String separator;
  +
  +    /**
        * The paths to search for templates.
        */
       protected List paths = null;
  @@ -95,6 +100,9 @@
           // Initialize parent class "classLoader" instance member.
           super.initLoader(configuration);
   
  +        separator = (resourceLoader instanceof FileResourceLoader ?
  +                     File.separator : "/");
  +
           paths = configuration.getVector("path");
   
           int size = paths.size();
  @@ -182,7 +190,7 @@
           throws Exception
        {
            return resourceLoader.getResourceStream(
  -                 path.length() > 0 ? path + "/" + name : name );
  +                 path.length() > 0 ? path + separator + name : name );
        }
   
        /**
  @@ -190,8 +198,6 @@
         */
        private String normalizePath(String path)
        {
  -         String separator = (resourceLoader instanceof FileResourceLoader ?
  -                             File.separator : "/");
            if (path.startsWith(separator))
            {
                path = path.substring(1);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to