Examples of FtpDataTransiver


Examples of org.exoplatform.frameworks.ftpclient.data.FtpDataTransiver

         int reply = getReply();

         if (reply == FtpConst.Replyes.REPLY_125 || reply == FtpConst.Replyes.REPLY_150)
         {
            FtpDataTransiver dataTransiver = clientSession.getDataTransiver();

            fileData = dataTransiver.receive();

            dataTransiver.close();

            String dd = new String(fileData, "windows-1251");

            String[] lines = dd.split("\r\n");
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.data.FtpDataTransiver

         int reply = getReply();

         if (reply == FtpConst.Replyes.REPLY_125)
         {
            FtpDataTransiver dataTransiver = clientSession.getDataTransiver();

            for (int i = 0; i < 15; i++)
            {
               if (!dataTransiver.isConnected())
               {
                  Thread.sleep(1000);
               }
            }

            byte[] data = dataTransiver.receive();
            dataTransiver.close();

            String dd = "";
            for (int i = 0; i < data.length; i++)
            {
               dd += (char)data[i];
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.data.FtpDataTransiver

         int reply = getReply();

         if (reply == FtpConst.Replyes.REPLY_125 || reply == FtpConst.Replyes.REPLY_150)
         {
            FtpDataTransiver dataTransiver = clientSession.getDataTransiver();

            fileData = dataTransiver.receive();

            dataTransiver.close();

            String dd = new String(fileData, "utf-8");

            String[] lines = dd.split("\r\n");
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.data.FtpDataTransiver

         return -1;
      }

      try
      {
         FtpDataTransiver dataTransiver = clientSession.getDataTransiver();

         if (dataTransiver != null)
         {
            for (int i = 0; i < 150; i++)
            {
               if (!dataTransiver.isConnected())
               {
                  Thread.sleep(100);
               }
            }
         }

         if (path == null)
         {
            sendCommand(FtpConst.Commands.CMD_STOR);
            return getReply();
         }

         sendCommand(String.format("%s %s", FtpConst.Commands.CMD_STOR, path));

         int reply = getReply();
         if (reply == FtpConst.Replyes.REPLY_125)
         {
            dataTransiver.send(fileContent);
            reply = getReply();
         }
         return reply;
      }
      catch (Exception exc)
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.data.FtpDataTransiver

         port = new Integer(addrValues[4]) * 256 + new Integer(addrValues[5]);

         if (FtpConst.Replyes.REPLY_227 == reply)
         {
            FtpDataTransiver dataTransiver = new FtpDataTransiverImpl();
            dataTransiver.OpenPassive(host, port);
            clientSession.setDataTransiver(dataTransiver);
         }

         return reply;
      }
View Full Code Here

Examples of org.exoplatform.services.ftp.data.FtpDataTransiver

      commandName = FtpConst.Commands.CMD_PASV;
   }

   public void run(String[] params) throws IOException
   {
      FtpDataTransiver transiver =
         clientSession().getFtpServer().getDataChannelManager().getDataTransiver(clientSession());

      if (transiver == null)
      {
         reply(FtpConst.Replyes.REPLY_421_DATA);
         return;
      }
      clientSession().setDataTransiver(transiver);

      StringBuilder serverLocation = new StringBuilder(clientSession().getServerIp().replace('.', ','));
      int dataPort = transiver.getDataPort();
      int high = dataPort / 256;
      int low = dataPort % 256;

      serverLocation.append(String.format(",%s,%s", high, low));
      reply(String.format(FtpConst.Replyes.REPLY_227, serverLocation.toString()));
View Full Code Here

Examples of org.exoplatform.services.ftp.data.FtpDataTransiver

         return;
      }

      try
      {
         FtpDataTransiver dataTransiver =
            new FtpDataTransiverImpl(host.toString(), port, clientSession().getFtpServer().getConfiguration(),
               clientSession());

         clientSession().setDataTransiver(dataTransiver);
         reply(String.format(FtpConst.Replyes.REPLY_200, "Port command success"));
View Full Code Here

Examples of org.exoplatform.services.ftp.data.FtpDataTransiver

         return;
      }

      try
      {
         FtpDataTransiver dataTransiver =
            new FtpDataTransiverImpl(host.toString(), port, clientSession().getFtpServer().getConfiguration(),
               clientSession());

         clientSession().setDataTransiver(dataTransiver);
         reply(String.format(FtpConst.Replyes.REPLY_200, "Port command success"));
View Full Code Here

Examples of org.exoplatform.services.ftp.data.FtpDataTransiver

      commandName = FtpConst.Commands.CMD_PASV;
   }

   public void run(String[] params) throws IOException
   {
      FtpDataTransiver transiver =
         clientSession().getFtpServer().getDataChannelManager().getDataTransiver(clientSession());

      if (transiver == null)
      {
         reply(FtpConst.Replyes.REPLY_421_DATA);
         return;
      }
      clientSession().setDataTransiver(transiver);

      String serverLocation = clientSession().getServerIp();
      serverLocation = serverLocation.replace('.', ',');

      int dataPort = transiver.getDataPort();
      int high = dataPort / 256;
      int low = dataPort % 256;

      serverLocation += String.format(",%s,%s", high, low);
      reply(String.format(FtpConst.Replyes.REPLY_227, serverLocation));
View Full Code Here

Examples of org.exoplatform.services.ftp.data.FtpDataTransiver

         return;
      }

      try
      {
         FtpDataTransiver dataTransiver =
            new FtpDataTransiverImpl(host, port, clientSession().getFtpServer().getConfiguration(), clientSession());

         clientSession().setDataTransiver(dataTransiver);
         reply(String.format(FtpConst.Replyes.REPLY_200, "Port command success"));
         return;
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.