CFLib.org – Common Function Library Project

normalizeFilePath(filePath)

Last updated September 9, 2008

author

S. Isaac Dealey

Version: 0 | Requires: CF6 | Library: FileSysLib

Description:
Turns c:\path\/to//dir/../other into c:\path\to\other - file or directory must already exist.

Return Values:
Returns a string.

Example:

<cfoutput>Put your files here: #normalizeFilePath("c:\path\/to//dir/../other")#</cfoutput>

Parameters:

Name Description Required
filePath The file path to format. Yes

Full UDF Source:

/**
 * normalizes a file path to remove invalid slashes and extra dots.
 * 
 * @param filePath 	 The file path to format. (Required)
 * @return Returns a string. 
 * @author S. Isaac Dealey (info@turnkey.to) 
 * @version 0, September 9, 2008 
 */
function normalizeFilePath(filePath) {
return CreateObject("java","java.io.File").init(filePath).getCanonicalPath();
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson