Apache FTPServer 自定义Command
<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");
页:
[1]