First put the Java class called into a jar package into the ColdFusion installation directory D:\ColdFusion9\lib.
Here is the call page:
<!---introduces classes that are invoked in the class--->
<cfscript>
Objfile=createobject ("Java", "java.io.File");
Objfileinstream=createobject ("Java", "Java.io.FileInputStream");
Objioutils=createobject ("Java", "org.apache.commons.io.IOUtils");
Objftpclient=createobject ("Java", "org.apache.commons.net.ftp.FTPClient");
</cfscript>
<!---my Java class is Ftptest1.java--->
<cfobject action= "Create" type= "java" class= "FtpTest1" name= "Ftpobjtest" >
<!---below is the Testupload () method in my Ftptest1.java. And I passed the parameters--->
<cfset result=ftpobjtest.testupload ("184.172.36.12", "Forus", "Qaz23sxa", "d:\\ data 2011-08-1---2011-08-31.xls" , "/bbs/communitypic", "Tangfuqiang.xls") >
<!---print out my Ftptest1.java. View Method--->
<cfdump var= "#ftpObjTest #" >
<!---print the value returned by my method--->
<cfoutput> #result #</cfoutput>--->