编写 Java FTP 服务器
我正在尝试编写一段代码,在我的单机上打开 FTP 服务器,以便我可以将文件从它复制到另一台计算机上的客户端,反之亦然,但我对服务器端编程非常陌生,不明白如何操作。
我得到了 Apache FtpServer 但对其使用有点困惑,我正在寻找基本的如何使用它的步骤。也许是这样的:
- 连接命令
- 登录
- 做一些事情......
I am trying to write a code that opens an FTP server on my stand-alone so I could copy file from it to a client in another computer and the opposite, but I am very new to server side programming and don't understand how.
I got the Apache FtpServer but got a little confused with it's use, and am looking for the basic steps of how to use it. Maybe something like:
- do connect command
- login
- do some things....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让我使用非常有用的 Apache FtpServer 为您编写一个基本示例:
请注意,在服务器端,您不必手动处理连接、登录等:Ftplet 会为您执行此操作你。
但是,您可以在匿名内部 Ftplet 类的重写方法中添加自定义预处理[或后]处理(当您使用
new Ftplet(){ ... }
实例化它时)。Let me write a basic example for you, using the very useful Apache FtpServer:
Note that, server-side, you don't have to deal manually with connects, logins, etc: the Ftplet does that for you.
You can, however, add your custom pre[or post]-processing inside the overridden methods of your anonymous inner Ftplet class (when you instantiate it with
new Ftplet(){ ... }
.