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:
- file server name/address
- user logon name and password and account
- sustained session
- file transfer type
- remote filename
- local filename
Events: (none)
Methods:
- logon
- logoff
- retrieve file
- store file
- delete file
- rename file
- retrieve file directory
- retrieve file list
- query current directory
- change directory
- change to parent directory
- create directory
- delete directory
- reset session
Copyright (c) Taligent, Inc. 1996 - 1997.
Copyright (c) IBM Corporation 1996 - 1997.
All Rights Reserved.
- See Also:
- FTPClient
-
FTPSession()
-
-
changeDirectory()
- Change directory.
-
createDirectory()
- Create directory.
-
currentDirectory()
- Retrieve current directory.
-
deleteDirectory()
- Delete directory.
-
deleteFile()
- Delete remote file.
-
getAccount()
- Get current account.
-
getLocalFilename()
- Return current local filename.
-
getPassword()
- Return the current password.
-
getRemoteFilename()
- Return current remote filename.
-
getServer()
- Return current FTP server.
-
getType()
- Return current file transfer type.
-
getUser()
- Return current user name.
-
isSustainedSession()
- Query sustained session.
-
logoff()
- Logoff.
-
logon()
- Logon.
-
main(String[])
-
-
parentDirectory()
- Change to parent directory (of the current remote directory)
-
renameFile()
- Rename remote file.
-
reset()
- Reset session and logoff.
-
retrieveDirectory()
- Retrieve remote directory of files.
-
retrieveFile()
- Retrieve remote file.
-
retrieveList()
- Retieve list of files in a remote directory.
-
setAccount(String)
- Set account.
-
setLocalFilename(String)
- Set local filename.
-
setPassword(String)
- Set password.
-
setRemoteFilename(String)
- Set remote filename.
-
setServer(String)
- Set file server name.
-
setSustainedSession(boolean)
- Set sustained session.
-
setType(char)
- Set file transfer type to ASCII or Image.
-
setUser(String)
- Set login name.
-
showBeanClient()
- Display the client for this bean.
-
storeFile()
- Store local file.
FTPSession
public FTPSession()
setServer
public void setServer(String server)
- Set file server name.
- Parameters:
- server - is the name to be set, of the FTP server
getServer
public String getServer()
- Return current FTP server.
setUser
public void setUser(String user)
- Set login name.
- Parameters:
- user - is the user name to be set
getUser
public String getUser()
- Return current user name.
setPassword
public void setPassword(String passwd)
- Set password.
- Parameters:
- password - is the FTP password for the server and user names specified
getPassword
public String getPassword()
- Return the current password.
setAccount
public void setAccount(String acct)
- Set account.
- Parameters:
- acct - is the account name to be set, for this user
getAccount
public String getAccount()
- Get current account.
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.
isSustainedSession
public boolean isSustainedSession()
- Query sustained session.
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
getType
public char getType()
- Return current file transfer type.
setRemoteFilename
public void setRemoteFilename(String filename)
- Set remote filename. Set the remote filename as follows:
- the name of a remote file to retrieve
- the new name of a stored file on the server
- the new name of a remote file to rename
- the name of a remote file to delete
- the name of a remote directory to list
- the name of a remote directory to change to
- the name of a remote directory to delete
- to null or "" if a remote filename is not desired
- Parameters:
- filename - is the name of the remote file for the FTP command
getRemoteFilename
public String getRemoteFilename()
- Return current remote filename.
setLocalFilename
public void setLocalFilename(String filename)
- Set local filename. Set the local filename as follows:
- the name of a local file to store
- the new name of a file retrieved from the server
- the current name of a remote file to rename
- to null or "" if a local filename is not desired
- Parameters:
- filename - is the name of the local file, for the FTP command
getLocalFilename
public String getLocalFilename()
- Return current local filename.
logon
public void logon() throws IOException
- Logon.
The user name and password must be set; account is
optional (some file servers may require it).
logoff
public void logoff() throws IOException
- Logoff.
Logoff from the FTP server.
retrieveFile
public void retrieveFile() throws IOException
- Retrieve remote file. The remote file name should be set before
this call is made.
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.
deleteFile
public void deleteFile() throws IOException
- Delete remote file. The remote file name should be set before
this call is made.
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.
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
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
currentDirectory
public String currentDirectory() throws IOException
- Retrieve current directory.
- Returns:
- the current directory at the remote server
changeDirectory
public void changeDirectory() throws IOException
- Change directory. Set remoteFilename to the name of the
directory to change to.
parentDirectory
public void parentDirectory() throws IOException
- Change to parent directory (of the current remote directory)
deleteDirectory
public void deleteDirectory() throws IOException
- Delete directory. Set remoteFilename to the name of the
directory to delete.
createDirectory
public void createDirectory() throws IOException
- Create directory. Set remoteFilename to the name of the
directory to create.
reset
public void reset() throws IOException
- Reset session and logoff.
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.
main
public static void main(String argv[])
All Packages Class Hierarchy This Package Previous Next Index