Package org.apache.commons.net

Examples of org.apache.commons.net.PrintCommandListener


       *
       */
      // TODO create a hidden debug-option to activate this listener
      if (objConnection2Options != null) {
        if (objConnection2Options.ProtocolCommandListener.value() == true) {
          listener = new PrintCommandListener(new PrintWriter(System.out));
          objFTPClient.addProtocolCommandListener(listener);
        }
      }

      listener = new PrintCommandListener(new PrintWriter(System.out));
      // TODO implement as an additional Option-setting
      String strAddFTPProtocol = System.getenv("AddFTPProtocol");
      if (strAddFTPProtocol != null && strAddFTPProtocol.equalsIgnoreCase("true")) {
        objFTPClient.addProtocolCommandListener(listener);
      }
View Full Code Here


       *
       */
      // TODO create a hidden debug-option to activate this listener
      if (objConnection2Options != null) {
        if (objConnection2Options.ProtocolCommandListener.value() == true) {
          listener = new PrintCommandListener(new PrintWriter(System.out));
          objFTPClient.addProtocolCommandListener(listener);
        }
      }
     
      listener = new PrintCommandListener(new PrintWriter(System.out));
      String strAddFTPProtocol = System.getenv("AddFTPProtocol");
      if (strAddFTPProtocol != null && strAddFTPProtocol.equalsIgnoreCase("true")) {
        objFTPClient.addProtocolCommandListener(listener);
      }

View Full Code Here

   * @see org.apache.commons.net.SocketClient#connect(java.lang.String, int)
   */
  public void connect(String host, int port) throws SocketException, IOException, UnknownHostException {
    if (!isConnected()) {

      listener = new PrintCommandListener(new PrintWriter(System.out));
      String strAddFTPProtocol = System.getenv("AddFTPProtocol");
      if (strAddFTPProtocol != null && strAddFTPProtocol.equalsIgnoreCase("true")) {
        this.addProtocolCommandListener(listener);
      }

View Full Code Here

    private PrintWriter out;

    private boolean open(String host, int port) throws Exception{
        System.out.println("Connecting to "+host);
        out = new PrintWriter(new FileWriter(new File(DOWNLOAD_DIR, host+"_info.txt")));
        listener = new PrintCommandListener(out);
        addProtocolCommandListener(listener);
        setConnectTimeout(30000);
        try {
            connect(host, port);
        } catch (Exception e) {
View Full Code Here

        String path;// = "/";

        new File(DOWNLOAD_DIR).mkdirs();
        DownloadListings self = new DownloadListings();
        OutputStream os = new FileOutputStream(new File(DOWNLOAD_DIR, "session.log"));
        self.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(os), true));

        Reader is = new FileReader("mirrors.list");
        BufferedReader rdr = new BufferedReader(is);
        String line;
        while((line=rdr.readLine()) != null){
View Full Code Here

      ftp.setControlKeepAliveReplyTimeout(controlKeepAliveReplyTimeout);
    }
    ftp.setListHiddenFiles(hidden);

    // suppress login details
    ftp.addProtocolCommandListener(new PrintCommandListener(
        new PrintWriter(System.out), true));

    try
    {
      int reply;
View Full Code Here

        server2 = args[4];
        username2 = args[5];
        password2 = args[6];
        file2 = args[7];

        listener = new PrintCommandListener(new PrintWriter(System.out));
        ftp1 = new FTPClient();
        ftp1.addProtocolCommandListener(listener);
        ftp2 = new FTPClient();
        ftp2.addProtocolCommandListener(listener);
View Full Code Here

        remote = args[base++];
        local = args[base];

        ftps = new FTPSClient(protocol);
      
        ftps.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

        try
        {
            int reply;
View Full Code Here

        password = args[base++];
        remote = args[base++];
        local = args[base];

        ftp = new FTPClient();
        ftp.addProtocolCommandListener(new PrintCommandListener(
                                           new PrintWriter(System.out)));

        try
        {
            int reply;
View Full Code Here

            {
                System.err.println("File not found. " + e.getMessage());
            }

            client = new SMTPClient();
            client.addProtocolCommandListener(new PrintCommandListener(
                                                  new PrintWriter(System.out)));

            client.connect(server);

            if (!SMTPReply.isPositiveCompletion(client.getReplyCode()))
View Full Code Here

TOP

Related Classes of org.apache.commons.net.PrintCommandListener

Copyright © 2018 www.massapicom. 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.