You are on page 1of 5

FTP

See code example

The FTP (File Transfer Protocol) component provides a simple interface for transmitting data to/from a FTP
server. The FTP component implements standards defined in RFC 959 and RFC 1579.

 Transfer mode support - Includes both ASCII and Binary modes for transferring text or binary data.
 Firewall support - Easily connect to FTP servers from behind a firewall.
 Automatic transfer mode detection - Sets transfer mode automatically based on file extension.
 Multiple file transfer - Transfer one or more files matching a regular expression e.g. *.txt
 Directory transfer - Transfer entire directories recursively, automatically recreating directory
structure on receiving side.
 Progress monitor - Built in event listeners to track the progress of file transfers including bytes
transferred, total time and total bytes transferred.
 Timeout support - Generates an exception when connection to FTP server cannot be established or
data cannot be read from FTP server within defined timeout.
 File transfer interruption - Ability to interrupt file transfers at any time.
 Message logging - Ability to stream messages exchanged between FTP client and server to a file.
 Memory based uploads - Ability to upload a file that exists in memory to FTP server.
 Memory based downloads - Ability to download file from FTP server and store in memory.
 Remote filesize and date - Easily query a remote file on FTP server for it's size and last
modification timestamp.
 Command execution - Send arbitrary commands to FTP server.
 Append support - Upload files to FTP server appending data sent to the end of of a file.
 Resume support - Resume interrupted file transfers

HTTP/HTTPS
See code example
The HTTP (Hypertext Transport Protocol) component provides a simple interface for developing customized
web client applications. Implementing the standard HTTP 1.0 specification allows the user to use the HTTP
component to retrieve documents from a HTTP server as well as submit form data for further processing by
a CGI application or Java servlet.
 GET, POST and PUT support - Full support for GET, POST and PUT operations emulating all the
core functionality of a typical web browser.
 SSL support - Access secure web pages
 File upload support - Easily upload files to a web server for processing by a CGI or servlet.
 Parameter management - Simple API allows easy addition or removal of CGI name/value
parameters from a HTTP request.
 Basic authentication - Provides methods for retrieving HTTP documents which require a user
supplied username and password.
 Cookie management - Add cookie values to a HTTP request, as well as retrieve cookie data from a
HTTP response.
 Header management - Easily define HTTP request header values for submission with a HTTP
request or retrieve header values from a HTTP response.
 Proxy support - Provides methods for retrieving HTTP documents from behind a firewall.

IMAP4
See code example
The IMAP4 (Internet Mail Access Protocol) component provides a simple interface for retrieving electronic
mail messages from a IMAP4 server. The IMAP4 component implements standards defined in RFC 1730
and RFC 2195.
 File attachment retrieval - A streamlined API provides easy to use methods for retrieving
attachments from an email message.
 Automatic message delete support - A convenient method to optionally delete messages
automatically after download from IMAP4 server.
 CRAM-MD5 authentication support. Per RFC 2195 CRAM-MD5 authentication provides a secure
means of transmitting username / password information when accessing an IMAP4 server.

MIME
The MimeMessage (Multipurpose Internet Mail Extensions) component provides a simple interface for
reading and composing MIME 1.0 compliant messages. Based upon standards defined in RFC 1521, the
MimeMessage component is typically used for sending and receiving e-mail and news messages which may
optionally contain non-ASCII data such as a file attachment.
 Multipart-MIME support - Simple API allows a user to easily create complex multi-part mime
messages.
 QuickMime helper class - The QuickMime helper class provides a simplified interface to mime
messages by exposing the most commonly used features of MimeMessage such as textual
messages and attachments. Access to most common e-mail and news headers is also provided.

NNTP
See code example
The NNTP (Network News Transport Protocol) component provides a simple interface for communicating
with Usenet, a public discussion forum consisting of various newsgroups. Implementing the standards
defined in RFC 977, the NNTP component can be used to easily navigate available newsgroups as well as
post and retrieve news articles.
 Article post and retrieval - Simple API makes it easy to connect to a NNTP server and post or
retrieve articles to/from NNTP server.
 MIME message support - NNTP component has a built in support for decoding MIME messages
which makes it very easy to download and automatically decode NNTP articles with one or more
attachments.
 User authorization support - Methods for username/password authentication are included for
connecting to NNTP servers which require authentication.
 Progress monitor - Part of the event handling capabilities of the NNTP component includes a
progress monitor which provides a real-time status of lengthy requests such as retrieving a list of
newsgroups or articles.

NSLOOKUP
The Nslookup component provides a simple interface for retrieving information about a specific hostname.
For example using the Nslookup component a user could easily determine the mail exchanger (MX)
resource responsible for handling hostname mail delivery. Nslookup component is based upon standards
defined in RFC 1035.
 Support for all major DNS resource records - With built-in support for 16 types of resource records
a user can easily lookup any type of information for a domain.

POP3
See code example
The POP3 (Post Office Protocol) component provides a simple interface for retrieving electronic mail
messages from a POP3 server. The POP3 component implements standards in RFC 1725 and RFC 1939.
 APOP and plain-text authentication - With built in support for both APOP (RFC 1939) and plain text
authentication modes, the POP3 component provides authentication support for the most popular
POP3 servers.
 File attachment retrieval - A streamlined API provides easy to use methods for retrieving
attachments from a POP3 message.
 Automatic message delete support - A convenient method to optionally delete messages
automatically after download from POP3 server.
 TOP support - Per RFC 1939 the TOP command allows preview of the first X lines without
downloading the entire message body.
REXEC
See code example
The Rexec component provides a simple interface for executing commands on UNIX machines.
Implementing the BSD rexec standard, the Rexec component allows for remote execution of commands on
UNIX hosts or other machines implementing the BSD rexec standard.
RLOGIN
See code example
The Rlogin component provides a simple interface for executing commands on UNIX machines.
Implementing the standards defined in RFC 1282 the Rlogin component provides a virtual terminal for
communicating with UNIX hosts or other machines implementing the Rlogin standard.
RSH
See code example
The Rsh component provides a simple interface for executing commands on UNIX machines. Implementing
the BSD rsh standard, the Rsh component allows for remote execution of commands on UNIX hosts or other
machines implementing the BSD rsh standard.
SMTP
See code example
The SMTP (Simple Mail Transfer Protocol) component provides a simple interface for sending electronic
mail messages. Implementing standards defined in RFC 821, RFC 822 and RFC 1521 the Smtp component
is capable of sending both simple and rich-text e-mail messages as well as one or more file attachments.
 File attachment support - The Smtp component provides a simple API for adding one or more
attachments to a e-mail message. Using this API one can easily add one or more attachments from
a file or URL.
 Bulk mail support - For targeted mail campaigns built in Bcc: (blind carbon copy) support and the
ability to define recipients from the contents of a file provide an easy API for delivering bulk e-mail
 HTML message support - For e-mail clients capable of rendering HTML, this feature allows one to
send rich-text e-mail to recipients in the form of a web page.
 Email address validation - The Smtp component supports all valid e-mail address formats specified
in RFC 822. Smtp and EmailAddress components offer syntax validation of address, prior to
sending e-mail message. This capability reduces network traffic from bounced e-mail messages
and provides a way of systematically identifying invalid e-mail addresses.
 User authentication - Methods to support username/password authentication for Smtp servers
which require authentication to prevent unauthorized Smtp relay.
 Message priority support - For e-mail clients which support message priorities, the Smtp
component allows prioritization of an e-mail message. A message with "highest" priority would
potentially give the message higher visibility in a recipients mailbox.
 Header management - Easily define SMTP e-mail header values for submission with a e-mail
message. An example might be to set the X-Mailer header typically used to define the client
software responsible for generating the mail message.

TELNET
See code example
The Telnet component provides framework for development of Telnet terminal applications in Java as well as
performing simple client tasks. The Telnet API implements: RFC 854, 855, 856, 857, 858, 859, 860, 1091,
1073, 1079, 1372 and provides TelnetOption component for implementing additional options.
 Telnet scripting - Using the provided TelnetScript and TelnetTask classes you can automate Telnet
tasks.
 Open Option development API - An Open Telnet Option API allows one to easily modify the Telnet
component to meet ones needs. Easily implement additional Telnet Options using this for
supporting additional options.
 Several Options bundled with API - BINARY, ECHO, LOGOUT, NAWS (window size), SUPPRESS-
GO-AHEAD, STATUS, TERMINAL-SPEED, TERMINAL-TYPE, TIMING-MARK, TOGGLE-FLOW-
CONTROL

IMAP4 Component
The IMAP4 (Internet Mail Access Protocol) component provides a simple interface for retrieving electronic
mail messages from a IMAP4 server. The IMAP4 component implements standards defined in RFC 1730
and RFC 2195. Download iNet Factory Evaluation

Features

 File attachment retrieval - A streamlined API provides easy to use methods for retrieving
attachments from an email message.
 Automatic message delete support - A convenient method to optionally delete messages
automatically after download from IMAP4 server.
 CRAM-MD5 authentication support. Per RFC 2195 CRAM-MD5 authentication provides a secure
means of transmitting username / password information when accessing an IMAP4 server.

Code Example

The following example demonstrates how to retrieve email from a


IMAP4 server.
/*
* @(#)ImapExample.java
*
* Copyright (c) 2001-2002 JScape
* 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information of
* JScape. ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with
* the terms of the license agreement you entered into with JScape.
*/

import com.jscape.inet.imap.*;
import com.jscape.inet.email.*;
import com.jscape.inet.mime.*;
import java.util.Enumeration;
import java.io.*;

public class ImapExample {

static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in


));

// get messages from Imap mailbox


public void getMessages(String hostname, String username, String password) throws I
mapException,
MimeException, IOException {
// create new Imap instance
Imap imap = new Imap(hostname,username,password);

// connect to IMAP4 server


imap.connect();

// retrieve total number of messages


int messageCount = imap.getMessageCount();
// print each message to console
for(int i = 1; i <= messageCount; i++) {
EmailMessage msg = imap.getMessage(i);
System.out.println("-- begin message --");
System.out.println(new String(msg.getMessage()));
System.out.println("-- end message --");
System.out.print("ENTER for next message or type QUIT to quit: ");
String command = reader.readLine();
if(command.equalsIgnoreCase("quit")) {
break;
}
}

// disconnect from IMAP4 server


imap.disconnect();
}

public static void main(String[] args) {


String hostname;
String username;
String password;

try {
System.out.print("Enter Imap hostname (e.g. mail.domain.com): ");
hostname = reader.readLine();
System.out.print("Enter Imap Username: ");
username = reader.readLine();
System.out.print("Enter Imap Password: ");
password = reader.readLine();
ImapExample example = new ImapExample();
example.getMessages(hostname,username,password);
}
catch(Exception e) {
e.printStackTrace();
}
}
}

You might also like