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

The absolute path

placeholder boolean
Default: false

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

Sample code invoking the contractPath function

Fork me on GitHub