blob: 35bb7cd8c32a6f057595ee7a0600f72840878950 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<document>
<properties>
<title>Overview</title>
<author email="dev@commons.apache.org">Apache Commons Documentation Team</author>
</properties>
<body>
<section name="Apache Commons Net">
<p>
Apache Commons Net&#x2122; library implements the client side of many basic
Internet protocols. The purpose of the library is to provide
fundamental protocol access, not higher-level
abstractions. Therefore, some of the design violates
object-oriented design principles. Our philosophy is to make the
global functionality of a protocol accessible (e.g., TFTP send
file and receive file) when possible, but also provide access to
the fundamental protocols where applicable so that the programmer
may construct his own custom implementations (e.g, the TFTP
packet classes and the TFTP packet send and receive methods are
exposed).
</p>
</section>
<section name="Features">
<p>
Supported protocols include:
<ul>
<li>FTP/FTPS</li>
<li>FTP over HTTP (experimental)</li>
<li>NNTP</li>
<li>SMTP(S)</li>
<li>POP3(S)</li>
<li>IMAP(S)</li>
<li>Telnet</li>
<li>TFTP</li>
<li>Finger</li>
<li>Whois</li>
<li>rexec/rcmd/rlogin</li>
<li>Time (rdate) and Daytime</li>
<li>Echo</li>
<li>Discard</li>
<li>NTP/SNTP</li>
</ul>
</p>
</section>
<section name="Background">
<p>
Apache Jakarta Commons Net started as a commercial Java library called
NetComponents, originally developed by ORO, Inc. in the early
days of Java. After its 1.3.8 release in 1998, the source code was
donated to the Apache Software Foundation and made available under
the Apache License. Since then, many programmers have contributed
to the continued development of Jakarta Commons Net. The current
version numbering scheme bears no relation to the old. In other
words, Jakarta Commons Net 1.0 succeeded and supplanted
NetComponents 1.3.8.
Apache Jakarta Commons is now an independent project and is called Apache Commons.
</p>
</section>
<section name="Examples">
<p>
Commons NET includes several working sample applications that you can use.
Source files are included in the source (and binary) archives, and a compiled jar is provided.
</p>
To use one of the sample applications, ensure that the example and main jars are both in the same directory.
Then run the class as per the following example:
<pre>java -jar [path/]commons-net-examples-3.1.jar FTPClientExample [parameters]</pre>
This uses the helper application which supports shorthand class names.
<br/>
Alternatively, ensure that the example and main jars are on the classpath.
Then invoke the class directly, for example:
<pre>java -cp commons-net-examples-3.1.jar;commons-net-3.1.jar examples/ftp/FTPClientExample [parameters]</pre>
<subsection name="FTP (package: examples/ftp)">
<ul>
<li><a href="examples/ftp/FTPClientExample.java">FTPClientExample</a>
demonstrates file download and upload, LIST, MLST etc over FTP(S) and FTP over HTTP
</li>
<li><a href="examples/ftp/ServerToServerFTP.java">ServerToServerFTP</a>
This program arranges a server to server file transfer that transfers a file from host1 to host2.
</li>
<li><a href="examples/ftp/TFTPExample.java">TFTPExample</a>
This is an example of a simple Java tftp client
</li>
</ul>
</subsection>
<subsection name="MAIL (package: examples/mail)">
<ul>
<li><a href="examples/mail/IMAPMail.java">IMAPMail</a>
This is an example program demonstrating how to use the IMAP[S]Client class.
</li>
<li><a href="examples/mail/POP3Mail.java">POP3Mail</a>
This is an example program demonstrating how to use the POP3[S]Client class.
</li>
<li><a href="examples/mail/SMTPMail.java">SMTPMail</a>
This is an example program demonstrating how to use the SMTP[S]Client class.
</li>
</ul>
</subsection>
<subsection name="NNTP (package: examples/nntp)">
<ul>
<li><a href="examples/nntp/ArticleReader.java">ArticleReader</a>
Simple class showing one way to read an article header and body.
</li>
<li><a href="examples/nntp/ExtendedNNTPOps.java">ExtendedNNTPOps</a>
Simple class showing some of the extended commands (AUTH, XOVER, LIST ACTIVE)
</li>
<li><a href="examples/nntp/ListNewsgroups.java">ListNewsgroups</a>
This is a simple example using the NNTP package to approximate the
Unix newsgroups command. It connects to the specified news
server and issues fetches the list of newsgroups stored by the server.
On servers that store a lot of newsgroups, this command can take a very
long time (listing upwards of 30,000 groups).
</li>
<li><a href="examples/nntp/MessageThreading.java">MessageThreading</a>
Sample program demonstrating the use of article iteration and threading.
</li>
<li><a href="examples/nntp/PostMessage.java">PostMessage</a>
This is an example program using the NNTP package to post an article to the specified newsgroup(s).
It prompts you for header information and a filename to post.
</li>
</ul>
</subsection>
<subsection name="NTP (package: examples/ntp)">
<ul>
<li><a href="examples/ntp/NTPClient.java">NTPClient</a>
This is an example program demonstrating how to use the NTPUDPClient
class. This program sends a Datagram client request packet to a
Network time Protocol (NTP) service port on a specified server,
retrieves the time, and prints it to standard output along with
the fields from the NTP message header (e.g. stratum level, reference id,
poll interval, root delay, mode, ...)
</li>
<li><a href="examples/ntp/TimeClient.java">TimeClient</a>
This is an example program demonstrating how to use the TimeTCPClient
and TimeUDPClient classes.
This program connects to the default time service port of a
specified server, retrieves the time, and prints it to standard output.
</li>
</ul>
</subsection>
<subsection name="TELNET (package: examples/telnet)">
<ul>
<li><a href="examples/telnet/TelnetClientExample.java">TelnetClientExample</a>
This is a simple example of use of TelnetClient.
</li>
<li><a href="examples/telnet/WeatherTelnet.java">WeatherTelnet</a>
This is an example of a trivial use of the TelnetClient class.
It connects to the weather server at the University of Michigan,
um-weather.sprl.umich.edu port 3000, and allows the user to interact
with the server via standard input.
</li>
</ul>
</subsection>
<subsection name="Unix utilities (package: examples/unix)">
<ul>
<li><a href="examples/unix/chargen.java">chargen</a>
This is a simple example of use of chargen.
</li>
<li><a href="examples/unix/daytime.java">daytime</a>
This is a simple example of use of daytime.
</li>
<li><a href="examples/unix/echo.java">echo</a>
This is a simple example of use of echo.
</li>
<li><a href="examples/unix/finger.java">finger</a>
This is a simple example of use of finger.
</li>
<li><a href="examples/unix/fwhois.java">fwhois</a>
This is a simple example of use of fwhois.
</li>
<li><a href="examples/unix/rdate.java">rdate</a>
This is a simple example of use of rdate.
</li>
<li><a href="examples/unix/rexec.java">rexec</a>
This is a simple example of use of rexec.
</li>
<li><a href="examples/unix/rlogin.java">rlogin</a>
This is a simple example of use of rlogin.
</li>
<li><a href="examples/unix/rshell.java">rshell</a>
This is a simple example of use of rshell.
</li>
</ul>
</subsection>
</section>
<section name="Further Information">
<p>
For more info, see the JavaDoc, or look at some of the following articles:
<ul>
<li><a href="http://www.informit.com/guides/content.asp?g=java&amp;seqNum=40">http://www.informit.com/guides/content.asp?g=java&amp;seqNum=40</a>Jakarta Commons - Net Class Library</li>
<li><a href="http://www.onjava.com/pub/a/onjava/2003/06/25/commons.html?page=3">http://www.onjava.com/pub/a/onjava/2003/06/25/commons.html?page=3</a>Using the Jakarta Commons, Part 1</li>
<li><a href="http://safari.phptr.com/0131478303/ch04">http://safari.phptr.com/0131478303/ch04</a>Apache Jakarta Commons: Reusable Java Components</li>
</ul>
</p>
</section>
</body>
</document>