简体   繁体   中英

How to use FTPClient in JDK1.7?

I have already created a project with FTP Client in JDK1.5. But i now i want to improve my JDK version to 1.7 . While trying to compile those java files using JDK1.7 it shows some error messages in FTP files . My code is like,

             **ftpObject.openServer(sServer);
            if (ftpObject.serverIsOpen()) {
                             System.out.println("Connected .." );
                              try {
                                ftpObject.login(sUserId, sPassword);
                                System.out.println(sUserId);
                                System.out.println(sPassword);
                                System.out.println(sSourceFileObj);
                                System.out.println(sDestFileObj);
                                System.out.println("$$$$$$$$$$$$$");
                                System.out.println(sSrcFileName);
                                System.out.println(sDestinationDirectory);
                                ftpObject.ascii();
                                ftpObject.uploadFile(sSourceFileObj, sDestFileObj);
                                } catch (Exception ftpe) {
                                    ftpe.printStackTrace();
                                    return false;
                                }
                                 finally {
                                    ftpObject.closeServer();
                                }
            } else {**

While try to compile i got error message like,

      **ftpObject.openServer(sServer);
                                      ^
      symbol:   method openServer(String)
      location: variable ftpObject of type GBMFtpWrapper
      GBMTransactionFile.java:2760: error: cannot find symbol

      if (ftpObject.serverIsOpen()) {
                                         ^
      symbol:   method serverIsOpen()
      location: variable ftpObject of type GBMFtpWrapper**

Should i add any jar files to compile this?

I've never heard of a class called GMBFtpWrapper ... and neither has Google.

I'm guessing that it must be defined in some private library that your application uses. Figure out which JAR file it is in, and then add it to the build path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM