tribble.net.ftp
Interface FTPClientI

All Superinterfaces:
FTPSimpleClientI
All Known Implementing Classes:
FTPClient, FTPClientAdapter, FTPSSLClient

public interface FTPClientI
extends FTPSimpleClientI

Basic FTP client interface. Allows clients to establish FTP connections, send and receive files, get remote directory listings, etc.

Since:
API 1.0, 2001-04-14
Version:
API 2.0 $Revision: 1.14 $ $Date: 2010/07/12 21:26:49 $
Author:
David R. Tribble (david@tribble.com).

Copyright 2001-2010 by David R. Tribble, all rights reserved.
Permission is granted to any person or entity except those designated by the United States Department of State as a terrorist, or terrorist government or agency, to use and distribute this source code provided that the original copyright notice remains present and unaltered.


Field Summary
static java.lang.String REV
          Revision information.
 
Method Summary
 void appendFile(java.lang.String src, java.lang.String dst)
          Append (send) a file from the local system to a file on the remote FTP system.
 void getDirectoryList(java.lang.String path, int max, java.io.OutputStream out)
          Get (receive) a directory listing from the remote FTP system.
 void getDirectoryList(java.lang.String path, java.io.OutputStream out)
          Get (receive) a directory listing from the remote FTP system.
 void getDirectoryNames(java.lang.String path, int max, java.io.OutputStream out)
          Get (receive) a list of filenames in a directory on the remote FTP system.
 void getDirectoryNames(java.lang.String path, java.io.OutputStream out)
          Get (receive) a list of filenames in a directory on the remote FTP system.
 void getFile(java.lang.String src, java.lang.String dst)
          Get (receive) a file from the remote FTP system to the local system.
 void getHelp(java.io.OutputStream out)
          Get (receive) a help listing of supported FTP commands from the remote FTP system.
 void getStatus(java.io.OutputStream out)
          Retrieve the current status of the remote FTP system.
 void getSystemInfo(java.io.OutputStream out)
          Retrieve the identity information of the remote FTP system.
 void login(java.lang.String user, java.lang.String pwd)
          Log in to the remote FTP system.
 void ping()
          Ping the remote FTP system.
 void putFile(java.lang.String src, java.lang.String dst)
          Put (send) a file from the local system to the remote FTP system.
 
Methods inherited from interface tribble.net.ftp.FTPSimpleClientI
appendFile, appendFile, connect, createDirectory, disconnect, getCommandPort, getDataPort, getDirectoryNames, getDirectoryNames, getFile, getFile, getHost, getLocalDir, getPassword, getRemoteDir, getTimeOut, getUserID, isConnected, isLoggedIn, login, putFile, putFile, removeDirectory, removeFile, rename, setBufferSize, setCommandPort, setDataPort, setHost, setLocalDir, setPassive, setPassword, setRemoteDir, setRemoteDirUp, setTextMode, setTimeOut, setUserID
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Method Detail

login

void login(java.lang.String user,
           java.lang.String pwd)
           throws java.io.IOException
Log in to the remote FTP system.

Parameters:
user - FTP user-ID for the remote system.
pwd - User password. This can be empty ("").
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
1.2, 2006-03-15
See Also:
login(), connect()

ping

void ping()
          throws java.io.IOException
Ping the remote FTP system. This sends a "NOOP" FTP command to the remote system and receives its reply.

Throws:
java.io.IOException - Thrown if an error occurs, e.g., the FTP connection is broken.
Since:
1.3, 2006-03-16

getSystemInfo

void getSystemInfo(java.io.OutputStream out)
                   throws java.io.IOException
Retrieve the identity information of the remote FTP system.

Parameters:
out - Output stream to which the identification information is to be written.
Throws:
java.io.IOException - Thrown if an I/O error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getStatus

void getStatus(java.io.OutputStream out)
               throws java.io.IOException
Retrieve the current status of the remote FTP system.

Parameters:
out - Output stream to which the status is to be written.
Throws:
java.io.IOException - Thrown if an I/O error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getHelp

void getHelp(java.io.OutputStream out)
             throws java.io.IOException
Get (receive) a help listing of supported FTP commands from the remote FTP system.

Parameters:
out - Output stream to which the help listing is to be written.
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getFile

void getFile(java.lang.String src,
             java.lang.String dst)
             throws java.io.IOException
Get (receive) a file from the remote FTP system to the local system.

Parameters:
src - Remote source filename. If this does not contain a directory prefix, the current remote working directory is assumed.
dst - Local source filename. If this does not contain a directory prefix, the current local working directory is assumed. This may be null, in which case the base filename of src (without the directory prefix) is used.
Throws:
java.io.IOException - Thrown if the file could not be transmitted or if any other error occurs.
Since:
1.1, 2001-04-14
See Also:
getFile(), getFile(), putFile(), appendFile()

putFile

void putFile(java.lang.String src,
             java.lang.String dst)
             throws java.io.IOException
Put (send) a file from the local system to the remote FTP system.

Parameters:
src - Local source filename. If this does not contain a directory prefix, the current local working directory is assumed.
dst - Remote target filename. If this does not contain a directory prefix, the current remote working directory is assumed. This may be null, in which case the base filename of src (without the directory prefix) is used.
Throws:
java.io.IOException - Thrown if the file could not be transmitted or if any other error occurs.
Since:
1.1, 2001-04-14
See Also:
putFile(), putFile(), appendFile(), getFile()

appendFile

void appendFile(java.lang.String src,
                java.lang.String dst)
                throws java.io.IOException
Append (send) a file from the local system to a file on the remote FTP system.

Parameters:
src - Local source filename. If this does not contain a directory prefix, the current local working directory is assumed.
dst - Remote target filename. If this does not contain a directory prefix, the current remote working directory is assumed. This may be null, in which case the base filename of src (without the directory prefix) is used.
Throws:
java.io.IOException - Thrown if the file could not be transmitted or if any other error occurs.
Since:
1.12, 2007-07-21
See Also:
appendFile(), appendFile(), putFile(), getFile()

getDirectoryList

void getDirectoryList(java.lang.String path,
                      java.io.OutputStream out)
                      throws java.io.IOException
Get (receive) a directory listing from the remote FTP system.

Parameters:
path - The remote directory or filename to list. If this is empty (""), the current remote working directory is assumed.
out - Output stream to which the directory listing is to be written.
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getDirectoryList

void getDirectoryList(java.lang.String path,
                      int max,
                      java.io.OutputStream out)
                      throws java.io.IOException
Get (receive) a directory listing from the remote FTP system.

Parameters:
path - The remote directory or filename to list. If this is empty (""), the current remote working directory is assumed.
max - Maximum number of filenames (output lines) to list. A value of zero (0) specifies that there is no maximum.
out - Output stream to which the directory listing is to be written.
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getDirectoryNames

void getDirectoryNames(java.lang.String path,
                       java.io.OutputStream out)
                       throws java.io.IOException
Get (receive) a list of filenames in a directory on the remote FTP system.

Parameters:
path - The remote directory or filename to list. If this is empty (""), the current remote working directory is assumed.
out - Output stream to which the directory listing is to be written.
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
API 2.0, 1.14, 2010-07-12

getDirectoryNames

void getDirectoryNames(java.lang.String path,
                       int max,
                       java.io.OutputStream out)
                       throws java.io.IOException
Get (receive) a list of filenames in a directory on the remote FTP system.

Parameters:
path - The remote directory or filename to list. If this is empty (""), the current remote working directory is assumed.
max - Maximum number of filenames to get. A value of zero (0) specifies that there is no maximum.
out - Output stream to which the directory listing is to be written.
Throws:
java.io.IOException - Thrown if an error occurs.
Since:
API 2.0, 1.14, 2010-07-12