本文整理汇总了Java中org.apache.commons.net.ProtocolCommandEvent.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ProtocolCommandEvent.getMessage方法的具体用法?Java ProtocolCommandEvent.getMessage怎么用?Java ProtocolCommandEvent.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.net.ProtocolCommandEvent
的用法示例。
在下文中一共展示了ProtocolCommandEvent.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例2: __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);
}
}
示例3: __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);
}
}