Created
June 14, 2013 16:21
-
-
Save tparton42/5783254 to your computer and use it in GitHub Desktop.
Example of how to use the Java IO File class inside a ColdFusion Function to determine the amount of free space.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="getFreeSpace" displayname="getFreeSpace" description="Use Java.io.File to return amount of free space in target path" access="public" output="false" returntype="any"> | |
<cfargument name="path" displayName="path" type="string" hint="File path" required="true" /> | |
<!--- Create an instance of the Java IO File Class ---> | |
<cfset var objFile = createObject("java", "java.io.File").init(arguments.path)/> | |
<!--- Return the amount of free space ---> | |
<cfreturn objFile.getFreeSpace() /> | |
</cffunction> <!--- End: checkFreeSpace() ---> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment