java代码中有一处错误,求修复。
javac命令编译的时候,出现一处错误:JMyFtpClient.java:89: 错误: 解析时已到达文件结尾
}
^
1 个错误
求修复.
程序代码:
import *; import *; import java.util.*; public class JMyFtpClient { /*Members*/ private FTPClientDrv m_FtpClient; /** * */ public JMyFtpClient() { super(); // TODO Auto-generated constructor stub m_FtpClient = null; } public static void main(String[] args) throws ClassNotFoundException, IOException { System.out.println("JMyFtpClient Started"); JMyFtpClient ftp = new JMyFtpClient(); if (false == ftp.Open("172.16.64.21", 21, "application", "application")) { System.out.println("OpenFail"); return; } if (false == ftp.DownloadDirectory("/appl/Tmpww", "C:\\TmpWw\\Down")) { trace("download Fail"); } /* if ( false == ftp.UploadDirectory( "C:\\TmpWw" , "/appl/Tmpww") ) trace( "Uplaod Directpry Fail" ); else trace( "Upload Directory Success" ); */ /* for ( int i=0; i < 0; i++ ) { int nByteDown = ftp.DownloadFile( "appl/3.txt" , "c:\\TmpWw\\Temp\\12" + i + ".txt" ); if ( nByteDown <= 0 ) System.out.println( "Download File Fail" ); else trace( "Download File Success" ); int nByteUp = ftp.UploadFile( "C:\\TmpWw\\1.txt" , "appl/Tmp/Tmp2/1" + i + ".txt" ); if ( nByteUp <= 0 ) System.out.println( "Upload File Fail" ); else trace( "Upload File Success" ); } */ ftp.Close(); System.out.println("JMyFtpClient Stopped"); } /*Open Connection*/ public boolean Open(String strServIPAddr, int nServPort, String strUserName, String strPassword) { try { m_FtpClient = new FTPClientDrv(strServIPAddr, nServPort); //Connect to Server m_FtpClient.login(strUserName, strPassword); m_FtpClient.setType(new FTPTransferType()); } catch (IOException e) { trace("Open Ftp Server Fail, IOException"); e.printStackTrace(); return false; } catch (FTPException e) { trace("Open Ftp server Fail, Ftp Exception"); e.printStackTrace(); return false; } trace("Login FTP Server Ok"); return true; }