All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.net.FTPSession

java.lang.Object
   |
   +----COM.ibm.beans.net.FTPSession

public class FTPSession
extends Object
implements Serializable
Java Bean that manages a FTP session with a file server.

Properties:

Events: (none)

Methods:

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 

See Also:
FTPClient

Constructor Index

 o FTPSession()

Method Index

 o changeDirectory()
Change directory.
 o createDirectory()
Create directory.
 o currentDirectory()
Retrieve current directory.
 o deleteDirectory()
Delete directory.
 o deleteFile()
Delete remote file.
 o getAccount()
Get current account.
 o getLocalFilename()
Return current local filename.
 o getPassword()
Return the current password.
 o getRemoteFilename()
Return current remote filename.
 o getServer()
Return current FTP server.
 o getType()
Return current file transfer type.
 o getUser()
Return current user name.
 o isSustainedSession()
Query sustained session.
 o logoff()
Logoff.
 o logon()
Logon.
 o main(String[])
 o parentDirectory()
Change to parent directory (of the current remote directory)
 o renameFile()
Rename remote file.
 o reset()
Reset session and logoff.
 o retrieveDirectory()
Retrieve remote directory of files.
 o retrieveFile()
Retrieve remote file.
 o retrieveList()
Retieve list of files in a remote directory.
 o setAccount(String)
Set account.
 o setLocalFilename(String)
Set local filename.
 o setPassword(String)
Set password.
 o setRemoteFilename(String)
Set remote filename.
 o setServer(String)
Set file server name.
 o setSustainedSession(boolean)
Set sustained session.
 o setType(char)
Set file transfer type to ASCII or Image.
 o setUser(String)
Set login name.
 o showBeanClient()
Display the client for this bean.
 o storeFile()
Store local file.

Constructors

 o FTPSession
 public FTPSession()

Methods

 o setServer
 public void setServer(String server)
Set file server name.

Parameters:
server - is the name to be set, of the FTP server
 o getServer
 public String getServer()
Return current FTP server.

 o setUser
 public void setUser(String user)
Set login name.

Parameters:
user - is the user name to be set
 o getUser
 public String getUser()
Return current user name.

 o setPassword
 public void setPassword(String passwd)
Set password.

Parameters:
password - is the FTP password for the server and user names specified
 o getPassword
 public String getPassword()
Return the current password.

 o setAccount
 public void setAccount(String acct)
Set account.

Parameters:
acct - is the account name to be set, for this user
 o getAccount
 public String getAccount()
Get current account.

 o setSustainedSession
 public void setSustainedSession(boolean sustained)
Set sustained session. Default is true.

A sustained session requires an explicit logon prior to invoking FTP services and an explicit logoff afterwards. An unsustained session performs its own logon and logoff.

 o isSustainedSession
 public boolean isSustainedSession()
Query sustained session.

 o setType
 public void setType(char t)
Set file transfer type to ASCII or Image. Default is ASCII. Type EBCDIC and Local not supported.

Parameters:
t - is the type (Text or Binary) for the file transfer
 o getType
 public char getType()
Return current file transfer type.

 o setRemoteFilename
 public void setRemoteFilename(String filename)
Set remote filename. Set the remote filename as follows:

Parameters:
filename - is the name of the remote file for the FTP command
 o getRemoteFilename
 public String getRemoteFilename()
Return current remote filename.

 o setLocalFilename
 public void setLocalFilename(String filename)
Set local filename. Set the local filename as follows:

Parameters:
filename - is the name of the local file, for the FTP command
 o getLocalFilename
 public String getLocalFilename()
Return current local filename.

 o logon
 public void logon() throws IOException
Logon.

The user name and password must be set; account is optional (some file servers may require it).

 o logoff
 public void logoff() throws IOException
Logoff.

Logoff from the FTP server.

 o retrieveFile
 public void retrieveFile() throws IOException
Retrieve remote file. The remote file name should be set before this call is made.

 o storeFile
 public void storeFile() throws IOException
Store local file. The local file name should be set before this call is made. Otherwise, the file transferred will have the same name as the remote file.

 o deleteFile
 public void deleteFile() throws IOException
Delete remote file. The remote file name should be set before this call is made.

 o renameFile
 public void renameFile() throws IOException
Rename remote file. Set remoteFilename to new name. Set the local filename property to the old name, and the remote filename property to the new name.

 o retrieveDirectory
 public String[] retrieveDirectory() throws IOException
Retrieve remote directory of files. Set remoteFilename to the name of the remote directory.

Returns:
all the contents of the remote directory
 o retrieveList
 public String[] retrieveList() throws IOException
Retieve list of files in a remote directory. Set remoteFilename to the name of the remote directory.

Returns:
a directory listing of the remote directory
 o currentDirectory
 public String currentDirectory() throws IOException
Retrieve current directory.

Returns:
the current directory at the remote server
 o changeDirectory
 public void changeDirectory() throws IOException
Change directory. Set remoteFilename to the name of the directory to change to.

 o parentDirectory
 public void parentDirectory() throws IOException
Change to parent directory (of the current remote directory)

 o deleteDirectory
 public void deleteDirectory() throws IOException
Delete directory. Set remoteFilename to the name of the directory to delete.

 o createDirectory
 public void createDirectory() throws IOException
Create directory. Set remoteFilename to the name of the directory to create.

 o reset
 public void reset() throws IOException
Reset session and logoff.

 o showBeanClient
 public void showBeanClient()
Display the client for this bean. The default implementation of this method will show the default Customizer for this bean, viz. the FTPSessionCustomizer. To show a different UI for this bean, this method must be overridden appropriately.

 o main
 public static void main(String argv[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index