当前位置: 首页>>代码示例>>Java>>正文


Java ProtocolCommandEvent类代码示例

本文整理汇总了Java中org.apache.commons.net.ProtocolCommandEvent的典型用法代码示例。如果您正苦于以下问题:Java ProtocolCommandEvent类的具体用法?Java ProtocolCommandEvent怎么用?Java ProtocolCommandEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ProtocolCommandEvent类属于org.apache.commons.net包,在下文中一共展示了ProtocolCommandEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
@Override
public void protocolCommandSent(
                                 ProtocolCommandEvent event ) {

    /* because we can only pause a file upload, we check if the event has a STOR command */
    if (event.getCommand().equals(FTPCmd.STOR.getCommand())) {
        // Check only progress events so the transfer be paused when the 
        // transfer is taking place not before or after it.
        log.debug("Progress event #" + (currentProgessEvent));
        if (currentProgessEvent++ == progressEventNumber && Thread.holdsLock(owner)) {
            try {
                log.debug("Waiting for the transfer to be resumed...");
                // Release the monitor and wait to be notified to continue the transfer.
                owner.wait();
            } catch (InterruptedException e) {
                log.error("Transfer thread interrupted while paused. Continue transfer.", e);
            }
        }

    }

}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:23,代码来源:SynchronizationFtpTransferListener.java

示例2: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolCommandSent(ProtocolCommandEvent event) {
  final StringBuilder sb = new StringBuilder("> ");
  String cmd = event.getCommand();
  if(!"PASS".equalsIgnoreCase(cmd) && !"USER".equalsIgnoreCase(cmd)) {
    if("LOGIN".equalsIgnoreCase(cmd)) {
      String msg = event.getMessage();
      msg = msg.substring(0, msg.indexOf("LOGIN") + "LOGIN".length());
      sb.append(msg).append(" *******");
    } else {
      sb.append(event.getMessage());
    }
  } else {
    sb.append(cmd).append(" *******");
  }
  logInternalMessage(sb.toString());
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:17,代码来源:BuildLogCommandListener.java

示例3: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
@Override
public void protocolCommandSent(final ProtocolCommandEvent event) {
    final String message = StringUtils.chomp(event.getMessage());
    if(message.startsWith(FTPCmd.PASS.name())) {
        this.log(Type.request, String.format("%s %s", FTPCmd.PASS.name(),
                StringUtils.repeat("*", StringUtils.length(StringUtils.removeStart(message, FTPCmd.PASS.name())))));
    }
    else {
        this.log(Type.request, message);
    }
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:12,代码来源:LoggingProtocolCommandListener.java

示例4: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolCommandSent(ProtocolCommandEvent event) {
  try {
    __logIt(event);
  } catch (IOException e) {
    if (__logger.isInfoEnabled()) {
      __logger.info("PrintCommandListener.protocolCommandSent(): " + e);
    }
  }
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:10,代码来源:PrintCommandListener.java

示例5: protocolReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolReplyReceived(ProtocolCommandEvent event) {
  try {
    __logIt(event);
  } catch (IOException e) {
    if (__logger.isInfoEnabled()) {
      __logger.info("PrintCommandListener.protocolReplyReceived(): " + e);
    }
  }
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:10,代码来源:PrintCommandListener.java

示例6: __logIt

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
private void __logIt(ProtocolCommandEvent event) throws IOException {
  if (!__logger.isInfoEnabled()) {
    return;
  }
  BufferedReader br = new BufferedReader(new StringReader(event.getMessage()));
  String line;
  while ((line = br.readLine()) != null) {
    __logger.info("ftp> " + line);
  }
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:11,代码来源:PrintCommandListener.java

示例7: fireCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void fireCommandSent(String command, String message) {
   ProtocolCommandEvent event = new ProtocolCommandEvent(this.__source, command, message);
   Iterator var5 = this.__listeners.iterator();

   while(var5.hasNext()) {
      EventListener listener = (EventListener)var5.next();
      ((ProtocolCommandListener)listener).protocolCommandSent(event);
   }

}
 
开发者ID:Bolt-Thrower,项目名称:xdm,代码行数:11,代码来源:ProtocolCommandSupport.java

示例8: fireReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void fireReplyReceived(int replyCode, String message) {
   ProtocolCommandEvent event = new ProtocolCommandEvent(this.__source, replyCode, message);
   Iterator var5 = this.__listeners.iterator();

   while(var5.hasNext()) {
      EventListener listener = (EventListener)var5.next();
      ((ProtocolCommandListener)listener).protocolReplyReceived(event);
   }

}
 
开发者ID:Bolt-Thrower,项目名称:xdm,代码行数:11,代码来源:ProtocolCommandSupport.java

示例9: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolCommandSent(ProtocolCommandEvent event) {
  try {
    __logIt(event);
  } catch (IOException e) {
    if (__logger.isInfoEnabled()) {
      __logger.info("PrintCommandListener.protocolCommandSent(): "+e);
    }
  }
}
 
开发者ID:yahoo,项目名称:anthelion,代码行数:10,代码来源:PrintCommandListener.java

示例10: protocolReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolReplyReceived(ProtocolCommandEvent event) {
  try {
    __logIt(event);
  } catch (IOException e) {
    if (__logger.isInfoEnabled()) {
      __logger.info("PrintCommandListener.protocolReplyReceived(): "+e);
    }
  }
}
 
开发者ID:yahoo,项目名称:anthelion,代码行数:10,代码来源:PrintCommandListener.java

示例11: __logIt

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
private void __logIt(ProtocolCommandEvent event) throws IOException {
  if (!__logger.isInfoEnabled()) { return; }
  BufferedReader br =
    new BufferedReader(new StringReader(event.getMessage()));
  String line;
  while ((line = br.readLine()) != null) {
    __logger.info("ftp> "+line);
  }
}
 
开发者ID:yahoo,项目名称:anthelion,代码行数:10,代码来源:PrintCommandListener.java

示例12: protocolReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
@Override
public void protocolReplyReceived(
                                   ProtocolCommandEvent event ) {

}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:6,代码来源:SynchronizationFtpTransferListener.java

示例13: protocolCommandSent

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
@Override
public void protocolCommandSent(
                                 ProtocolCommandEvent event ) {

}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:6,代码来源:FtpResponseListener.java

示例14: protocolReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
@Override
public void protocolReplyReceived(final ProtocolCommandEvent event) {
    this.log(Type.response, StringUtils.chomp(event.getMessage()));
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:5,代码来源:LoggingProtocolCommandListener.java

示例15: protocolReplyReceived

import org.apache.commons.net.ProtocolCommandEvent; //导入依赖的package包/类
public void protocolReplyReceived(ProtocolCommandEvent event) {
  logInternalMessage("< " + event.getMessage());
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:4,代码来源:BuildLogCommandListener.java


注:本文中的org.apache.commons.net.ProtocolCommandEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。