Lucee 6.2.0.321 ExpandPath("*.*") error

I have been using GetDirectoryFromPath(ExpandPath("*.*")) to get the base path of the site as in the example in https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-e-g/getdirectoryfrompath.html

However, this results in an error with Lucee 6.2.0.321

A workaround appears to be GetDirectoryFromPath(GetBaseTemplatePath())

OS: Windows 11 and Windows Server 2025
Java Version: 21.0.6+7-LTS
Tomcat Version: 9.0.100
Lucee Version: 6.2.0.321

I’ve never used asterisks when defining a relative path for ExpandPath(). I would just use:

ExpandPath( "./" )

for the current directory and this works on Lucee 6.2.0.321.

You’re right though that ExpandPath( "*.*" ) does work on Lucee 5.

For basePath (I guess it’s the webroot) I use:

ExpandPath("/")

That works fine.

If the file your code is running in is in the base directory (e.g. Application.cfc) then you can avoid ExpandPath() altogether:

baseDirectory = GetDirectoryFromPath( GetCurrentTemplatePath() )

this is due to a change in java 21, which killed performance relating to getCanonicalPath no longer being cached

https://luceeserver.atlassian.net/browse/LDEV-5218

as it’s a regression, Jira

lucee.runtime.exp.NativeException: Illegal char <*> at index 30: D:\work\lucee6\test\functions\*.*
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
	at java.base/java.io.File.toPath(File.java:2401)
	at lucee.commons.io.res.type.file.FileResource.getCanonicalPath(FileResource.java:158)
	at lucee.runtime.functions.system.ExpandPath.toReturnValue(ExpandPath.java:137)
	at lucee.runtime.functions.system.ExpandPath.call(ExpandPath.java:113)
	at functions.expandpath_cfc$cf$5.udfCall2(/test/functions/expandpath.cfc:107)
	at functions.expandpath_cfc$cf$5.udfCall(/test/functions/expandpath.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)