Package org.apache.ftpserver.interfaces

Examples of org.apache.ftpserver.interfaces.FtpIoSession


    public Set<FtpIoSession> getActiveSessions() {
        Map<Long,IoSession> sessions = acceptor.getManagedSessions();
       
        Set<FtpIoSession> ftpSessions = new HashSet<FtpIoSession>();
        for(IoSession session : sessions.values()) {
            ftpSessions.add(new FtpIoSession(session, context));
        }
        return ftpSessions;
    }
View Full Code Here


    this.ftpHandler = ftpHandler;
  }

  public void exceptionCaught(IoSession session, Throwable cause)
      throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.exceptionCaught(ftpSession, cause);
  }
View Full Code Here

      ftpHandler.exceptionCaught(ftpSession, cause);
  }

  public void messageReceived(IoSession session, Object message)
      throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      FtpRequest request = new FtpRequestImpl(message.toString());
     
      ftpHandler.messageReceived(ftpSession, request);
  }
View Full Code Here

     
      ftpHandler.messageReceived(ftpSession, request);
  }

  public void messageSent(IoSession session, Object message) throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.messageSent(ftpSession, (FtpReply)message);
  }
View Full Code Here

      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.messageSent(ftpSession, (FtpReply)message);
  }

  public void sessionClosed(IoSession session) throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionClosed(ftpSession);
  }
View Full Code Here

      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionClosed(ftpSession);
  }

  public void sessionCreated(IoSession session) throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionCreated(ftpSession);
  }
View Full Code Here

      ftpHandler.sessionCreated(ftpSession);
  }

  public void sessionIdle(IoSession session, IdleStatus status)
      throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionIdle(ftpSession, status);
  }
View Full Code Here

      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionIdle(ftpSession, status);
  }

  public void sessionOpened(IoSession session) throws Exception {
      FtpIoSession ftpSession = new FtpIoSession(session, context);
      ftpHandler.sessionOpened(ftpSession);
  }
View Full Code Here

       
        sb.append('\n');
        Iterator<IoSession> sessionIterator = sessions.values().iterator();
       
        while(sessionIterator.hasNext()) {
            FtpIoSession managedSession = new FtpIoSession(sessionIterator.next(), context);

            if(!managedSession.isLoggedIn()) {
                continue;
            }
           
            User tmpUsr = managedSession.getUser();
            sb.append( StringUtils.pad(tmpUsr.getName(), ' ', true, 16) );
           
            if(managedSession.getRemoteAddress() instanceof InetSocketAddress) {
              sb.append( StringUtils.pad(((InetSocketAddress)managedSession.getRemoteAddress()).getAddress().getHostAddress(), ' ', true, 16) );
            }
            sb.append( StringUtils.pad(DateUtils.getISO8601Date(managedSession.getLoginTime().getTime()), ' ', true, 20) );
            sb.append( StringUtils.pad(DateUtils.getISO8601Date(managedSession.getLastAccessTime().getTime()), ' ', true, 20) );
            sb.append('\n');
        }
        sb.append('\n');
        session.write(new DefaultFtpReply(FtpReply.REPLY_200_COMMAND_OKAY, sb.toString()));
    }
View Full Code Here

        assertTrue(client.login(ADMIN_USERNAME, ADMIN_PASSWORD));
        assertTrue(FTPReply.isPositiveCompletion(client.noop()));
    }

    public void testClientCertificates() throws Exception {
        FtpIoSession session = server.getListener("default")
                .getActiveSessions().iterator().next();
        assertEquals(1, session.getClientCertificates().length);

        X509Certificate cert = (X509Certificate) session
                .getClientCertificates()[0];

        assertTrue(cert.getSubjectDN().toString().contains("FtpClient"));
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.interfaces.FtpIoSession

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.