GNU inetlib is a library of clients for common internet protocols.
The following protocols are currently supported:
- Hypertext Transfer Protocol (HTTP)
- File Transfer Protocol (FTP)
- Simple Mail Transfer Protocol (SMTP)
- Internet Message Access Protocol (IMAP)
- Post Office Protocol (POP)
- Network News Transfer Protocol (NNTP)
- Lightweight Directory Access Protocol (LDAP) (alpha)
The inetlib library is similar in intent to the Python internet protocols
library - the API is as close as possible to the intent of the underlying
protocol design. This allows for very efficient coding of user agents.
Additionally, inetlib includes URLStreamHandler implementations for some
of the protocols. These can be used to add support for the corresponding
URL scheme to the java.net.URL class.
The inetlib HTTP client supports HTTP/1.1 as described in RFC 2616, with
the following features:
- Persistent connections
- Basic and Digest authentication (RFC 2617)
- HTTP proxies
- HTTP/1.0 compatibility
- Support for WebDAV methods and other HTTP extensions
- Automatic decoding of the chunked transfer-coding
- Parsing of HTTP date headers
- Support for the 100-continue expectation
The design of the API is similar to the
WebDAV/HTTP library. A logical connection to the server is instantiated,
and multiple requests can be issued on this connection. Each request has
dispatch method which returns the response.
All I/O, authentication, etc is handled by registering callback objects
with the request prior to dispatch, which are notified during the dispatch
procedure as necessary. Simple byte-array content callbacks are supplied
which can manage any request/response content that fits in available memory.
An URL stream handler is provided, supporting the full HttpURLConnection
The inetlib FTP client supports both active and passive mode FTP and all
transfer modes and representation types. The client implements RFC 959,
with the following exceptions and limitations:
- Only one concurrent transfer connection is supported
- The STAT, HELP, SITE, SMNT, and ACCT commands are not supported
- The TYPE command does not allow alternatives to the default bytesize
(Non-print), and local bytesize is not supported
An URL stream handler is provided, which allows the setting of transfer modes
and representation types by means of the
The inetlib SMTP client fully implements RFC 2821 including the ESMTP
The client also implements TLS negotiation (RFC 3207) and SASL
authentication (RFC 2554).
The inetlib IMAP client fully implements IMAP4rev1 and includes the
- Extensible authentication using any available SASL mechanism
- TLS negotiation (RFC 2595)
- Automatic UTF-7imap folder name decoding/encoding
- IMAP over SSL
The inetlib POP client implements version 3 only, as specified in RFC 1939,
with the exception of the no-arg LIST and UIDL commands (use STAT followed
by multiple LIST and/or UIDL instead).
It supports the following features:
- The POP3 extension mechanism CAPA
- Extensible authentication using any available SASL mechanism via
the AUTH mechanism (RFC 1734)
- TLS negotiation (RFC 2595)
The inetlib NNTP client implements all of RFC 977, and many of the common
NNTP extensions specified in RFC 2980. It supports the XOVER and XHDR
commands, and simple authentication.
There is also a newsrc mechanism for storing newsgroup subscriptions and read
articles in an implementation-independent manner, including a file-based