FTP 客户端Java 类库,ftp4j 1.7.2 发布
jopen 12年前
<p><a href="/misc/goto?guid=4958322440182900423" target="_blank">ftp4j</a>是一个FTP客户端Java类库,实现了FTP客户端 应具有的大部分功能。可以将ftp4j嵌到你的Java应用中,来传输文件(包括上传和下 载),浏览远程FTP服务器上的目录和文件,创建、删除、重命,移动远程目录和文件。ftp4j提供多种方式连接到远程FTP服务器包括:通过 TCP/IP直接连接,通过FTP代理、HTTP代理、SOCKS4/4a代理和SOCKS5代理连接,通过SSL安全连接。</p> <ul> <li><strong>Price, licence and support</strong> <ul> <li>Just a word: <strong>LGPL</strong>. The ftp4j library is <strong>100% Free Software</strong>.</li> </ul> </li> <li><strong>Connectivity</strong><br /> The ftp4j library can connect the remote FTP server: <ul> <li>Through a direct TCP/IP connection.</li> <li>Through a <strong>FTP proxy</strong>.</li> <li>Tunnelling through a <strong>HTTP proxy</strong>.</li> <li>Through a <strong>SOCKS 4/4a proxy</strong>.</li> <li>Through a <strong>SOCKS 5 proxy</strong>.</li> <li>You can add support to other proxies plugging your own connector, since the ftp4j connection manager architecture is modular.</li> </ul> </li> <li><strong>Security</strong> <ul> <li>Basic FTP authentication.</li> <li><strong>FTPS</strong> (FTP over <strong>implicit TLS/SSL</strong>).</li> <li><strong>FTPES</strong> (FTP over <strong>explicit TLS/SSL</strong>).</li> </ul> </li> <li><strong>Browsing the remote site</strong> <ul> <li>FTP <strong>LIST and MLSD command support</strong> through <strong>extensible parser architecture</strong>. <strong>Bundled parsers</strong> can handle: <strong>UNIX style</strong> listing, <strong>MAC style</strong>, <strong>DOS style</strong>, <strong>NetWare style</strong> and variants, <strong>EPLF style</strong> and <strong>MLST / MLSD</strong> responses. Moreover you can build your own parser and plug it in the library.</li> <li><strong>Clear object representation of directory contents</strong>.</li> </ul> </li> <li><strong>Download and upload</strong> <ul> <li><strong>Active</strong> and <strong>passive</strong> transfer mode support.</li> <li><strong>Binary</strong> and <strong>textual</strong> transfer type support, with optional and extensible type <strong>auto-selection</strong>.</li> <li><strong>Compressed</strong> transfer mode support (<strong>MODE Z</strong>).</li> <li><strong>Event-based transfer monitoring</strong>.</li> <li>Transfer <strong>abortion</strong> support.</li> <li>Transfer <strong>resume</strong> support.</li> <li><strong>Append mode</strong> upload support.</li> </ul> </li> <li><strong>Java exceptions</strong> <ul> <li><strong>Structured exceptions</strong> let the developer know the <strong>real cause</strong> of any failure.</li> </ul> </li> </ul> <p>示例代码:</p> <pre class="brush:java; toolbar: true; auto-links: false;">FTPClient client = new FTPClient(); client.connect("ftp.host.com", port); client.login("carlo", "mypassword"); client.createDirectory("newfolder"); client.disconnect(true);</pre> <br /> ftp4j 1.7.2 发布,该版本修复了下载模块方面的bug,正确处理了 "502 Command REST not allowed by policy" 消息。 <p></p>