ftpserver/src/main/java/net/zb/examination/ftp/AbstractCommand.java
2020-04-19 17:52:24 +08:00

32 lines
727 B
Java
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package net.zb.examination.ftp;
import io.netty.channel.ChannelHandlerContext;
import net.zb.examination.ftp.constant.FtpCommand;
import net.zb.examination.ftp.util.CommandContainer;
/**
* <p></p>
*
* @author bin.zhang
* <p/>
* Revision History:
* 2020/04/15, 初始化版本
* @version 1.0
**/
public abstract class AbstractCommand {
protected AbstractCommand(){
FtpCommand ftpCommand = this.getClass().getAnnotation(FtpCommand.class);
if(ftpCommand == null){
throw new IllegalArgumentException("加载类: [" + this.getClass() +"]失败未配置FtpCommand注解");
}
CommandContainer.add(ftpCommand.value(), this);
}
public abstract String process(ChannelHandlerContext ctx, String[] msg);
}