You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:04:32 UTC

[jira] Closed: (VELOCITY-144) Allow absolute filename with FileResourceLoader

     [ https://issues.apache.org/jira/browse/VELOCITY-144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen closed VELOCITY-144.
-------------------------------------------


> Allow absolute filename with FileResourceLoader
> -----------------------------------------------
>
>                 Key: VELOCITY-144
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-144
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.3-rc1
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Dale Peakall
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: absolute.zip, AbsoluteFileResourceLoaderTest.java, FileResourceLoader.java.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org