Package org.apache.commons.net.ftp

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


    }

    public void destroyObject(Object obj) throws Exception
    {
        FTPClient client = (FTPClient) obj;
        client.logout();
        client.disconnect();
    }

    public boolean validateObject(Object obj)
    {
View Full Code Here


            ftpClient.storeFile(fileName, input);
          }
          }
        }
      input.close();
      ftpClient.logout();
    } catch (Exception e) {
      logger.error("推送FTP失败", e);
    } finally {//最后关闭连接
      try {
        ftpClient.disconnect();
View Full Code Here

       */
      if (clienteFtp != null)
        try {
          System.out.println("Cerrando conexi�n y desconectando del servidor . . .");
          if (clienteFtp.isConnected()) {
            clienteFtp.logout();
            clienteFtp.disconnect();
          }
        } catch (IOException ioe) {
          ioe.printStackTrace();
        }
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

        if (!ftp.storeFile(file.getName(), new FileInputStream(file))) {
          throw new FTPException("Error during FTP store file.");
        }

      } finally {
        ftp.logout();
      }

      String cmntText = "The file "
          + fileName
          + " exceeds the byte limit to attach a file to a case; therefore, the file was uploaded to "
View Full Code Here

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

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

                ftp.retrieveFile(remote, output);

                output.close();
            }

            ftp.logout();
        }
        catch (FTPConnectionClosedException e)
        {
            error = true;
            System.err.println("Server closed connection.");
View Full Code Here

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

      client.login(username, password);
     
      fis = new FileInputStream(fileName);
     
      client.storeFile(fileName, fis);
      client.logout();
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
View Full Code Here

      client.login(username, password);
     
      fis = new FileInputStream(fileName);
     
      client.storeFile(fileName, fis);
      client.logout();
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
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.