Package org.exoplatform.frameworks.ftpclient.commands

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdPasv


         assertEquals(FtpConst.Replyes.REPLY_425, client.executeCommand(cmdStor));
      }

      // desired reply - 500 STOR: command requires a parameter
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

         CmdStor cmdStor = new CmdStor(null);
         cmdStor.setFileContent(fileContent);
         assertEquals(FtpConst.Replyes.REPLY_500, client.executeCommand(cmdStor));
      }

      String fileName = "test_stor_file_" + System.currentTimeMillis() + ".txt";

      // desired reply - 550 test_stor_file.txt: Permission denied
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

         CmdStor cmdStor = new CmdStor(fileName);
         cmdStor.setFileContent(fileContent);
         assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(cmdStor));
      }

      // desired reply - 125 Data connection already open; Transfer starting
      // 226 Transfer complete
      {
         assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

         CmdStor cmdStor = new CmdStor(fileName);
         cmdStor.setFileContent(fileContent);
         assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdStor));
      }

      // desired reply - 550 Restore value invalid
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
         assertEquals(FtpConst.Replyes.REPLY_350, client.executeCommand(new CmdRest(1000)));

         CmdStor cmdStor = new CmdStor(fileName);
         cmdStor.setFileContent(fileContent);
         assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(cmdStor));
View Full Code Here


      // desired reply - 125 Data connection already open; Transfer starting
      // 226 Transfer complete
      {
        assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));
        assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

        CmdStor cmdStor = new CmdStor(fileName);
        cmdStor.setFileContent(fileContent);
        assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdStor));
      }
View Full Code Here

         assertEquals(FtpConst.Replyes.REPLY_425, client.executeCommand(new CmdRetr(null)));
      }

      // desired reply - 500 RETR: command requires a parameter
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
         assertEquals(FtpConst.Replyes.REPLY_500, client.executeCommand(new CmdRetr(null)));
      }

      String fileName = "test_file_" + System.currentTimeMillis() + ".txt";
      byte[] fileContent = "THIS FILE CONTENT".getBytes();

      // desired reply - 550 $: Permission denied
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
         assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(new CmdRetr(fileName)));
      }

      {
         assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

         CmdStor cmdStor = new CmdStor(fileName);
         cmdStor.setFileContent(fileContent);
         assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdStor));
      }

      // desired reply - 125 Data connection already open; Transfer starting
      // 226 Transfer complete
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
         CmdRetr cmdRetr = new CmdRetr(fileName);
         assertEquals(FtpConst.Replyes.REPLY_226, client.executeCommand(cmdRetr));
      }

      // desired reply - 550 Restore value invalid
      {
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));
         assertEquals(FtpConst.Replyes.REPLY_350, client.executeCommand(new CmdRest(100000)));

         CmdRetr cmdRetr = new CmdRetr(fileName);
         assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(cmdRetr));
      }
View Full Code Here

         assertEquals(FtpConst.Replyes.REPLY_425, client.executeCommand(cmdNlst));
      }

      {
         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
         }

         {
            CmdNlst cmdNlst = new CmdNlst("NotExistFolder");
            assertEquals(FtpConst.Replyes.REPLY_450, client.executeCommand(cmdNlst));
         }
      }

      {
         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
         }

         // Normal executing replies sequence 125..226
         // 125 used in NLst command inside
View Full Code Here

      {
         FtpClientSession client = FtpTestConfig.getTestFtpClient();
         client.connect();

         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(cmdPasv));
         }

         {
            CmdUser cmdUser = new CmdUser(FtpTestConfig.USER_ID);
            assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(cmdUser));
         }

         {
            CmdPass cmdPass = new CmdPass(FtpTestConfig.USER_PASS);
            assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(cmdPass));
         }

         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
         }

         log.info("Waiting for connection...");
View Full Code Here

         assertEquals(FtpConst.Replyes.REPLY_425, client.executeCommand(cmdList));
      }

      {
         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
         }

         {
            CmdList cmdList = new CmdList("NotExistFolder");
            assertEquals(FtpConst.Replyes.REPLY_450, client.executeCommand(cmdList));
         }
      }

      {
         {
            CmdPasv cmdPasv = new CmdPasv();
            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
         }

         // Normal executing replies sequence 125..226
         // 125 used in List command inside
View Full Code Here

      String filePath = "/production/test_size_file.txt";
      String fileContent = "This test File for SIZE command.";
      int fileSize = fileContent.length();

      {
         CmdPasv cmdPasv = new CmdPasv();
         assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(cmdPasv));
      }

      {
         CmdStor cmdStor = new CmdStor(filePath);
View Full Code Here

TOP

Related Classes of org.exoplatform.frameworks.ftpclient.commands.CmdPasv

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.