`
sd8089730
  • 浏览: 251868 次
  • 性别: Icon_minigender_1
  • 来自: 吉林
社区版块
存档分类
最新评论

Apache FTPServer 自定义Command

    博客分类:
  • FTP
 
阅读更多
 <commands>
  <command name="NewCustomCommand">
   <beans:bean
    class="com.zl.ftpserver.command.NewCustomCommand" />
  </command>
 </commands>

 

import java.io.IOException;

import org.apache.ftpserver.command.Command;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.ftplet.FtpRequest;
import org.apache.ftpserver.impl.FtpIoSession;
import org.apache.ftpserver.impl.FtpServerContext;

public class NewCustomCommand implements Command {
	public void execute(FtpIoSession session, FtpServerContext context,
			FtpRequest request) throws IOException, FtpException {
		System.out.println("哇哈哈");

	}
}

 

client.sendCustomCommand("NewCustomCommand");

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics