Beispiel #1
0
 @Override
 public void disconnect() {
   LOGGER.info("Disconnecting from " + username() + "@" + host() + ":" + String.valueOf(port()));
   executionHandler(
       new Callable<Void>() {
         @Override
         public Void call() throws Exception {
           reconnect = false;
           if (ftpClient.isConnected()) {
             ftpClient.logout();
             ftpClient.disconnect();
           }
           return null;
         }
       });
 }
Beispiel #2
0
 @Override
 public void connect() {
   LOGGER.info("Connecting to " + username() + "@" + host() + ":" + String.valueOf(port()));
   reconnect = true;
   try {
     ftpClient.connect(host(), port());
   } catch (IOException e) {
     throw new VirtualFileException(e);
   }
   if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
     disconnect();
     return;
   }
   login();
   setFileType(FTP.BINARY_FILE_TYPE);
 }