contractPath

Opposite of expandpath.

Tries to match a given absolute path to mappings in the environment and will return a path that is contracted by the shortest matched mapping. If there are no matches, Lucee returns the absolute path it was given.

contractPath(path [, placeholder]) → returns string

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Argument Reference

path_absolute string
Required

The absolute path

placeholder boolean
Default: false

A boolean indicating whether Lucee placeholder names should be prefixed to the path.

Examples
Sample code invoking the contractPath function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub