Share

FreeMarker

Tracker: Bugs

5 FileTemplateLoader root directory problem - ID: 2887792
Last Update: Settings changed ( ddekany )

Consider running a project with the java "user.dir" property beeing
somewhere on "c:\" (not directly in the root).
There is no way of making the FileTemplateLoader accept loading files from
anywhere in c:\.
This is the reason: specifying the root for the FileTemplateLoader as "c:"
will resolve in fact to "user.dir" which may be any folder inside c.
Specifying the root as "c:\" will fail with a SecurityException because
when the FileTemplateLoader creates the canonicalPath, it automatically
appends File.separatorChar, therefore the root path will be "c:\\".
Consequently, any template on "c:" will fail to load with a
SecurityException saying that the specified template's path does not start
with "c:\\"...obviously it starts with just "c:\"


Nobody/Anonymous ( nobody ) - 2009-10-28 09:26

5

Open

Fixed

Nobody/Anonymous

Loading and caching

None

Public


Comment ( 1 )




Date: 2009-10-28 09:41
Sender: ddekanyProject Admin

This is already fixed in the SVN:
http://freemarker.svn.sourceforge.net/viewvc/freemarker/branches/2.3/freemarker/src/freemarker/cache/FileTemplateLoader.java?content-type=text/vnd.viewcvs-markup&root=&r1=1140&r2=1141

This fix will appear in 2.3.16, which should be released in weeks. Until
that, if you may try the nightly builds, or patch 2.3.15 manually according
the above diff.


Log in to comment.

Attached File

No Files Currently Attached

Change ( 1 )

Field Old Value Date By
resolution_id None 2009-10-28 09:41 ddekany