Class JDPFtpClient

java.lang.Object
   |
   +----JDPFtpClient

public class JDPFtpClient
extends Object

Variable Index

 o type

Constructor Index

 o JDPFtpClient(JDPJob)
Create a instance of the Ftp Client to allow file transfer.
 o JDPFtpClient(StringBuffer)
Create a instance of the Ftp Client to allow file transfer.

Method Index

 o abort()
Abort the current operation.
 o changeDir(String)
Set the full path of the new remote directory.
 o connect(String)
Connect to the requested host name or IP address.
 o deleteDir(String)
Delete a directory from the remote server.
 o deleteFile(String)
Delete a file from the remote server.
 o disconnect()
Disconnect from the remote server.
 o fileList()
Get a Vector containing a set of JDPFtpFileInfo objects that describe the files and directories in the current remote directory.
 o getCurrentLocalDir()
Get the full path of the current local directory.
 o getFile(String)
Get a file from the remote machine.
 o getRemoteCurrentDir()
Get the full path of the current remote directory.
 o getStatus()
Get the current status from the remote machine.
 o login(String, String)
Login to the remote server.
 o makeDir(String)
Create a directory on the remote server.
 o putFile(String)
Put a file on the remote machine.
 o rename(String, String)
Rename a file on the remote machine.
 o setCurrentLocalDir(String)
Set the full path of the new local directory.
 o setType(String)
Set the type of file transfer to use.

Variables

 o type
 public String type

Constructors

 o JDPFtpClient
 public JDPFtpClient(JDPJob thisJob)
Create a instance of the Ftp Client to allow file transfer.

Parameters:
thisJob - the handle to the current job for server side instances.
 o JDPFtpClient
 public JDPFtpClient(StringBuffer outBuffer)
Create a instance of the Ftp Client to allow file transfer.

Parameters:
outBuffer - a StringBuffer to accept all the output from the ftp server.

Methods

 o getCurrentLocalDir
 public String getCurrentLocalDir()
Get the full path of the current local directory.

Returns:
the full path of the current local directory.
 o setCurrentLocalDir
 public void setCurrentLocalDir(String dir)
Set the full path of the new local directory.

Parameters:
dir - the full path of the new local directory.
 o getRemoteCurrentDir
 public String getRemoteCurrentDir()
Get the full path of the current remote directory.

Returns:
the full path of the current remote directory.
 o getFile
 public boolean getFile(String fileName)
Get a file from the remote machine.

Parameters:
fileName - the name of the file to retrieve.
Returns:
whether the file was successfully retrieved.
 o getStatus
 public String getStatus()
Get the current status from the remote machine.

Returns:
the current status from the remote machine.
 o setType
 public int setType(String type)
Set the type of file transfer to use.

Parameters:
the - type of file transfer to use (ASCII or BINARY).
Returns:
the reply code from the remote server after setting the new type.
 o abort
 public boolean abort()
Abort the current operation.

Returns:
whether the abort attempt was successful.
 o changeDir
 public boolean changeDir(String newDir)
Set the full path of the new remote directory.

Parameters:
dir - the full path of the new remote directory.
Returns:
whether the change dir completed successfully.
 o connect
 public boolean connect(String hostName)
Connect to the requested host name or IP address.

Parameters:
hostName - the host name or IP address of the machine to connect to.
Returns:
whether the connection attempt was successful.
 o deleteDir
 public boolean deleteDir(String dirName)
Delete a directory from the remote server.

Parameters:
dirName - the name of the directory to remove in the current remote directory.
Returns:
whether the delete attempt was successful.
 o deleteFile
 public boolean deleteFile(String fileName)
Delete a file from the remote server.

Parameters:
fileName - the name of the file to remove in the current remote directory.
Returns:
whether the delete attempt was successful.
 o disconnect
 public boolean disconnect()
Disconnect from the remote server.

Returns:
whether the disconnection attempt was successful.
 o fileList
 public Vector fileList()
Get a Vector containing a set of JDPFtpFileInfo objects that describe the files and directories in the current remote directory.

Returns:
Vector containing a set of JDPFtpFileInfo objects.
 o login
 public boolean login(String userName,
                      String passwd)
Login to the remote server.

Parameters:
username - the user name to use to login with.
password - the password to use to login with.
Returns:
whether the login attempt was successful.
 o makeDir
 public boolean makeDir(String dirName)
Create a directory on the remote server.

Parameters:
dirName - the name of the directory to create in the current remote directory.
Returns:
whether the create attempt was successful.
 o putFile
 public boolean putFile(String fileName)
Put a file on the remote machine.

Parameters:
fileName - the name of the file to send.
Returns:
whether the file was successfully sent.
 o rename
 public boolean rename(String oldName,
                       String newName)
Rename a file on the remote machine.

Parameters:
oldName - the current name of the file to rename.
newName - the new name of the file.
Returns:
whether the file was successfully renamed.