Package org.apache.commons.net.ftp

Examples of org.apache.commons.net.ftp.FTPClient.logout()


      client.storeFile("entryToken.txt", in);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      res = true;
      client.logout();
     
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try
View Full Code Here


      if (debugMode)
        System.out.print(client.getReplyString());

      fis.close();

      client.logout();
      if (debugMode)
        System.out.print(client.getReplyString());
      res = true;

    } catch (java.io.IOException e) {
View Full Code Here

      client.retrieveFile(filename, fos);
      if (!FTPReply.isPositiveCompletion(client.getReplyCode())) {
        return false;
      }
      res = true;
      client.logout();
    } catch (java.io.IOException e) {
      e.printStackTrace();
    } finally {
      try {
        if (fos != null) {
View Full Code Here

            res.setResponseMessage(ex.toString());
        } finally {
            savedClient = null;
            if (ftp.isConnected()) {
                try {
                    ftp.logout();
                } catch (IOException ignored) {
                }
                try {
                    ftp.disconnect();
                } catch (IOException ignored) {
View Full Code Here

                                }
                            }
                        }
                    }
                }
                ftp.logout();
            }
        } catch (IOException ioe) {
            Debug.log(ioe, "[putFile] caught exception: " + ioe.getMessage(), module);
            errorList.add("Problem with FTP transfer: " + ioe.getMessage());
        } finally {
View Full Code Here

                    if (!ftp.retrieveFile((String) context.get("remoteFilename"), localFile)) {
                        errorList.add("File not received succesfully: " + ftp.getReplyString());
                    }
                }
                ftp.logout();
            }
        } catch (IOException ioe) {
            errorList.add("Problem with FTP transfer: " + ioe.getMessage());
        } finally {
            if (ftp.isConnected()) {
View Full Code Here

        {
            try
            {
                if (ftp1.isConnected())
                {
                    ftp1.logout();
                    ftp1.disconnect();
                }
            }
            catch (IOException e)
            {
View Full Code Here

            throw new BuildException("error during FTP transfer: " + ex);
        } finally {
            if (ftp != null && ftp.isConnected()) {
                try {
                    log("disconnecting", Project.MSG_VERBOSE);
                    ftp.logout();
                    ftp.disconnect();
                } catch (IOException ex) {
                    // ignore it
                }
            }
View Full Code Here

        {
            try
            {
                if (ftp1.isConnected())
                {
                    ftp1.logout();
                    ftp1.disconnect();
                }
            }
            catch (IOException e)
            {
View Full Code Here

__main:
        try
        {
            if (!ftp.login(username, password))
            {
                ftp.logout();
                error = true;
                break __main;
            }

            System.out.println("Remote system is " + ftp.getSystemType());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.