Class JDPFtpClient
java.lang.Object
|
+----JDPFtpClient
- public class JDPFtpClient
- extends Object
-
type
-
-
JDPFtpClient(JDPJob)
- Create a instance of the Ftp Client to allow file transfer.
-
JDPFtpClient(StringBuffer)
- Create a instance of the Ftp Client to allow file transfer.
-
abort()
- Abort the current operation.
-
changeDir(String)
- Set the full path of the new remote directory.
-
connect(String)
- Connect to the requested host name or IP address.
-
deleteDir(String)
- Delete a directory from the remote server.
-
deleteFile(String)
- Delete a file from the remote server.
-
disconnect()
- Disconnect from the remote server.
-
fileList()
- Get a Vector containing a set of JDPFtpFileInfo objects that describe the
files and directories in the current remote directory.
-
getCurrentLocalDir()
- Get the full path of the current local directory.
-
getFile(String)
- Get a file from the remote machine.
-
getRemoteCurrentDir()
- Get the full path of the current remote directory.
-
getStatus()
- Get the current status from the remote machine.
-
login(String, String)
- Login to the remote server.
-
makeDir(String)
- Create a directory on the remote server.
-
putFile(String)
- Put a file on the remote machine.
-
rename(String, String)
- Rename a file on the remote machine.
-
setCurrentLocalDir(String)
- Set the full path of the new local directory.
-
setType(String)
- Set the type of file transfer to use.
type
public String type
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.
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.
getCurrentLocalDir
public String getCurrentLocalDir()
- Get the full path of the current local directory.
- Returns:
- the full path of the current local directory.
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.
getRemoteCurrentDir
public String getRemoteCurrentDir()
- Get the full path of the current remote directory.
- Returns:
- the full path of the current remote directory.
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.
getStatus
public String getStatus()
- Get the current status from the remote machine.
- Returns:
- the current status from the remote machine.
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.
abort
public boolean abort()
- Abort the current operation.
- Returns:
- whether the abort attempt was successful.
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.
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.
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.
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.
disconnect
public boolean disconnect()
- Disconnect from the remote server.
- Returns:
- whether the disconnection attempt was successful.
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.
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.
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.
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.
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.