[ http://issues.apache.org/jira/browse/VELOCITY-144?page=all ] Will Glass-Husain resolved VELOCITY-144: ----------------------------------------
Resolution: Fixed Assign To: (was: Velocity-Dev List) no one argued against this. patch applied. > Allow absolute filename with FileResourceLoader > ----------------------------------------------- > > Key: VELOCITY-144 > URL: http://issues.apache.org/jira/browse/VELOCITY-144 > Project: Velocity > Type: Improvement > Components: Source > Versions: 1.3-rc1 > Environment: Operating System: All > Platform: PC > Reporter: Dale Peakall > Priority: Minor > Fix For: 1.5 > Attachments: AbsoluteFileResourceLoaderTest.java, > FileResourceLoader.java.patch, absolute.zip > > 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]