DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17379>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17379

Can't use absolute filename with FileResourceLoader

           Summary: Can't use absolute filename with FileResourceLoader
           Product: Velocity
           Version: 1.3-rc1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Source
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


There is no way of providing an absolute path (e.g. c:\temp\wibble.tmp) to the 
FileResourceLoader because it always attempts to use the 2-argument File 
constructor (even if the path component is empty).

The following fix resolves this problem:
In FileResourceLoader.findTemplate replace:
  File file = new File( path, template );
with
  File file = null;

  if("".equals(path))
    file = new File( template );
  else
    file = new File ( path, template );

Note this does not introduce any security risks as the FileResourceLoader must 
be configured to search the empty ("") path.

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

Reply via email to