|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.network.ftp.protocol.FTPProtocol
This class provides FTP protocol services. All the frequently used FTP commands is implemented by this class and provided in the form of APIs. This FTP protocol can connect to a FTP server outside a firewall and automatically interact in passive mode. It listens for CommandEvents by implementing CommandListener . The CommandEvent carries the command name to be executed. This class throws StatusEvent which carries the current status of FTP connection. This class throws LocalFileListEvent and RemoteFileListEvent which carry the local and remote current directory and their file listing. The details of local and remote files are stored in a vector of FileInfo objects.
CommandListener
,
StatusEvent
,
RemoteFileListEvent
,
LocalFileListEvent
,
FileInfo
,
Response
, Serialized FormField Summary | |
protected java.beans.PropertyChangeSupport |
propertyChange
|
Constructor Summary | |
FTPProtocol()
Creates an object of FTPProtocol class. |
Method Summary | |
void |
abort()
Aborts the last issued command. |
void |
addLocalFileListListener(com.ibm.network.ftp.event.LocalFileListListener listener)
Adds the specified LocalFileListListener to receive LocalFileListEvents from this FTPProtocol object. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field. |
void |
addRemoteFileListListener(com.ibm.network.ftp.event.RemoteFileListListener listener)
Adds the specified RemoteFileListListener to receive RemoteFileListEvents from this FTPProtocol object. |
void |
addStatusListener(com.ibm.network.ftp.event.StatusListener listener)
Adds the specified StatusListener to receive StatusEvents from this FTPProtocol object. |
void |
changeDir(java.lang.String newName,
boolean remote)
Changes directory whose pathname is specified by the first string parameter. |
void |
changeDirList(java.lang.String newName,
boolean remote)
Changes directory whose pathname is specified by the first string parameter. |
void |
commandPerformed(com.ibm.network.ftp.event.CommandEvent cevent)
Implements the commandPerformed method defined in CommandListener interface. |
void |
configureSocks(java.lang.String hostName,
java.lang.String port)
Configures socksProxyHost and socksProxyPort. |
void |
connect(java.lang.String hostName)
Connects to the specified host. |
void |
connect(java.lang.String hostName,
java.lang.String port)
Connects to the specified host. |
void |
connectLogin(java.lang.String hostName,
java.lang.String user,
java.lang.String pwd)
Connects to the specified host. |
void |
connectLogin(java.lang.String hostName,
java.lang.String port,
java.lang.String user,
java.lang.String pwd)
Connects to the specified host. |
void |
deleteFile(java.lang.String fileName,
boolean remote)
Deletes the specified file. |
void |
deleteFile(java.util.Vector fileNames,
boolean remote)
Deletes the specified file(s). |
void |
deleteFileList(java.lang.String fileName,
boolean remote)
Deletes the specified file. |
void |
deleteFileList(java.util.Vector fileNames,
boolean remote)
Deletes the specified file(s). |
void |
disconnect()
Disconnect from the FTP server. |
void |
fileList(boolean remote)
This method lists files from the current working directory. |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
The firePropertyChange method was generated to support the propertyChange field. |
int |
getBufferSize()
Gets the bufferSize property value. |
protected boolean |
getBusy()
Gets the busy property value. |
int |
getBytesRead()
Gets the bytesRead property value which shows the count of read bytes for downloading file. |
int |
getBytesWrite()
Gets the bytesWrite property (int) value. |
java.lang.String |
getCurrentDir(boolean remote)
Gets the current working directory. |
void |
getFile(java.lang.String fileName)
Download the specified file from the FTP server. |
void |
getFile(java.lang.String fileName,
java.lang.String localFileName)
Download the specified file from the FTP server. |
void |
getFile(java.util.Vector fileNames)
Download the specified file(s) from the FTP server. |
void |
getFileList(java.lang.String fileName)
Download the specified file(s) from the FTP server. |
void |
getFileList(java.util.Vector fileNames)
Download the specified file(s) from the FTP server. |
java.io.InputStream |
getInpStream()
Return current input stream. |
java.lang.String |
getLocalDir()
Returns the current local directory. |
java.util.Vector |
getLocalFileList()
Returns a Vector of FileInfo objects. |
java.lang.String |
getName()
This method was created in VisualAge. |
java.io.OutputStream |
getOutStream()
Return current output stream. |
java.lang.String |
getPortString()
|
protected java.beans.PropertyChangeSupport |
getPropertyChange()
Accessor for the propertyChange field. |
java.lang.String |
getRemoteDir()
Returns the FTP server working directory. |
java.util.Vector |
getRemoteFileList()
Returns a Vector of FileInfo objects. |
java.lang.String |
getRemoteOperatingSystem()
Returns the Operating System. |
protected Remote |
getRemoteProtocol()
This method was created by a SmartGuide. |
boolean |
getRestartable()
Gets the restartable property (boolean) value which indicates restartable feature for FTP server. |
int |
getRestartCount()
Gets the restartCount property (int) value. |
int |
getRestartCounter()
Gets the restartCounter property (int) value which indicates restart attempts. |
java.lang.String |
getSocksProxyHost()
Returns socksProxyHost. |
java.lang.String |
getSocksProxyPort()
Returns socksProxyPort. |
java.lang.String |
getStatus()
This method returns the latest status of connection to FTP server. |
int |
getTimeout()
Gets the timeout property in ms (int) value which indicates the period of time after which the bean breaks the socket connection if the expected remark has not been received. |
java.lang.String |
getType()
This method returns the data transfer type,ie., either "ASCII" or "BINARY". |
boolean |
isStreamedInput()
Return streamedInput flag. |
boolean |
isStreamedOutput()
Rerturn streamedOutput flag. |
void |
list(boolean remote)
Initializes remote or local file list. |
void |
login(java.lang.String userName,
java.lang.String passwd)
This method lets the user login to the connected FTP server. |
void |
makeDir(java.lang.String dirName,
boolean remote)
This method creates a directory in the current working directory. |
void |
makeDirList(java.lang.String dirName,
boolean remote)
This method creates a directory in the current working directory. |
void |
passiveServer()
This method lets the user to configure the FTP server in passive mode. |
void |
putFile(java.lang.String fileName)
Upload the specified file or specified input stream to the FTP server. |
void |
putFile(java.lang.String fileName,
java.lang.String remoteFileName)
Upload the specified file to the FTP server and stores it as the 2nd parameter. |
void |
putFile(java.util.Vector fileNames)
Upload the specified file(s) to the FTP server. |
void |
putFileList(java.lang.String fileName)
Upload the specified file to the FTP server. |
void |
putFileList(java.util.Vector fileNames)
Upload the specified file(s) to the FTP server. |
void |
quote(java.lang.String param)
Sends a QUOTE specific command to the FTP server |
void |
removeDir(java.lang.String dirName,
boolean remote)
Remove the named directory. |
void |
removeList(java.lang.String dirName,
boolean remote)
Remove the named directory or file. |
void |
removeList(java.util.Vector dirNames,
boolean remote)
Remove the named directories or files. |
void |
removeLocalFileListListener(com.ibm.network.ftp.event.LocalFileListListener listener)
Removes the specified LocalFileListListener so that it no longer receives LocalFileListEvents from this protocol. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field. |
void |
removeRemoteFileListListener(com.ibm.network.ftp.event.RemoteFileListListener listener)
Removes the specified RemoteFileListListener so that it no longer receives RemoteFileListEvents from this protocol. |
void |
removeStatusListener(com.ibm.network.ftp.event.StatusListener listener)
Removes the specified StatusListener so that it no longer receives StatusEvents from this protocol. |
void |
rename(java.lang.String oldName,
java.lang.String newName,
boolean remote)
Renames the file specified by the first argument to the name given by second argument. |
void |
renameList(java.lang.String oldName,
java.lang.String newName,
boolean remote)
Renames the file specified by the first argument to the name given by second argument. |
void |
setBufferSize(int bufferSize)
Sets the bufferSize property (int) value. |
protected void |
setBytesRead(int bytesRead)
Sets the bytesRead property (int) value. |
protected void |
setBytesWrite(int bytesWrite)
Sets the bytesWrite property (int) value. |
void |
setInpStream(java.io.InputStream in)
Sets the inpStream property. |
void |
setName(java.lang.String newValue)
Sets the name property. |
void |
setOutStream(java.io.OutputStream out)
Sets the outStream property. |
void |
setPortString(java.lang.String i)
|
protected void |
setRestartable(boolean restartable)
Sets the restartable property (boolean) value. |
void |
setRestartCount(int restartCount)
Sets the restartCount property (int) value. |
protected void |
setRestartCounter(int counter)
This method was created in VisualAge. |
void |
setSocksProxyHost(java.lang.String socksProxyHost)
Sets the SocksProxyHost. |
void |
setSocksProxyPort(java.lang.String socksProxyPort)
Sets the SocksProxyPort. |
void |
setStreamedInput(boolean in)
Sets the streamedInput property. |
void |
setStreamedOutput(boolean out)
Sets the streamedOutput property. |
void |
setTimeout(int timeout)
Sets the timeout property in ms (int) value indicates the period of time after which the bean breaks the socket connection if the expected remark has not been received. |
void |
setType(java.lang.String newType)
This method sets the "TYPE" to be used for data transfer on the data connection. |
void |
site(java.lang.String s)
Sends a Site specific command to the FTP server |
void |
status()
Execute the status command on FTP server. |
void |
system()
Sends a SYST command to the FTP server |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient java.beans.PropertyChangeSupport propertyChange
Constructor Detail |
public FTPProtocol()
Method Detail |
public void abort()
public void addLocalFileListListener(com.ibm.network.ftp.event.LocalFileListListener listener)
listener
- LocalFileListListenerLocalFileListListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addRemoteFileListListener(com.ibm.network.ftp.event.RemoteFileListListener listener)
listener
- RemoteFileListListenerRemoteFileListListener
public void addStatusListener(com.ibm.network.ftp.event.StatusListener listener)
listener
- StatusListenerStatusListener
public void changeDir(java.lang.String newName, boolean remote) throws java.lang.IllegalArgumentException
newName
- the new directory name.remote
- this boolean argument specifies whether the change directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If user tries to change directory without specifying
the new directory name.public void changeDirList(java.lang.String newName, boolean remote) throws java.lang.IllegalArgumentException
newName
- the new directory name.remote
- this boolean argument specifies whether the change directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If user tries to change directory without specifying
the new directory name.public void commandPerformed(com.ibm.network.ftp.event.CommandEvent cevent) throws java.lang.IllegalArgumentException
commandPerformed
in interface com.ibm.network.ftp.event.CommandListener
cevent
- CommandEventjava.lang.IllegalArgumentException
- If user calls this method with CommandEvent argument as null.CommandListener
public void configureSocks(java.lang.String hostName, java.lang.String port) throws java.lang.IllegalArgumentException
hostName
- the socksProxyHost IP or domain name.port
- the socksProxyPort.java.lang.IllegalArgumentException
- If any of the arguments are null.public void connect(java.lang.String hostName) throws java.lang.IllegalArgumentException
hostName
- the IP address of the FTP server.java.lang.IllegalArgumentException
- If the host name specified is null.public void connect(java.lang.String hostName, java.lang.String port) throws java.lang.IllegalArgumentException
hostName
- the IP address of the FTP server.port
- the port of the FTP server.java.lang.IllegalArgumentException
- If the host name specified is null.public void connectLogin(java.lang.String hostName, java.lang.String user, java.lang.String pwd)
hostName
- the IP address of the FTP server.user
- user name of the user profile on the FTP server.pwd
- password of user profile on the FTP server.java.lang.IllegalArgumentException
- If the host name specified is null.public void connectLogin(java.lang.String hostName, java.lang.String port, java.lang.String user, java.lang.String pwd)
hostName
- the IP address of the FTP server.port
- the port number of the FTP server.user
- user name of the user profile on the FTP server.pwd
- password of user profile on the FTP server.java.lang.IllegalArgumentException
- If the host name specified is null.public void deleteFile(java.lang.String fileName, boolean remote) throws java.lang.IllegalArgumentException
fileName
- name of the file to be deleted.remote
- this boolean argument specifies whether the file deletion
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the file name specified is null.public void deleteFile(java.util.Vector fileNames, boolean remote) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which contains file
names to be deleted.remote
- this boolean argument specifies whether the file deletion
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the file name specified is null.public void deleteFileList(java.lang.String fileName, boolean remote) throws java.lang.IllegalArgumentException
fileName
- name of the file to be deleted.remote
- this boolean argument specifies whether the file deletion
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the file name specified is null.public void deleteFileList(java.util.Vector fileNames, boolean remote) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which contains name of
the file to be deleted.remote
- this boolean argument specifies whether the file deletion
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the file name specified is null.public void disconnect()
public void fileList(boolean remote)
remote
- this boolean argument specifies whether the file listing
is for local machine or FTP server.public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
public int getBufferSize()
setBufferSize(int)
protected boolean getBusy()
public int getBytesRead()
public int getBytesWrite()
public java.lang.String getCurrentDir(boolean remote)
remote
- this boolean argument specifies whether this method
is executes for local machine or FTP server.public void getFile(java.lang.String fileName) throws java.lang.IllegalArgumentException
fileName
- name of the file to be downloaded.java.lang.IllegalArgumentException
- If the specified file name is null.public void getFile(java.lang.String fileName, java.lang.String localFileName) throws java.lang.IllegalArgumentException
fileName
- name of the file to be downloaded.localFileName
- name of the target locla file.java.lang.IllegalArgumentException
- If the specified file name is null.public void getFile(java.util.Vector fileNames) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which
contains names of the file to be downloaded.java.lang.IllegalArgumentException
- If the specified vector is null.public void getFileList(java.lang.String fileName) throws java.lang.IllegalArgumentException
fileNames
- name of the file to be downloaded.java.lang.IllegalArgumentException
- If the specified fileName is null.public void getFileList(java.util.Vector fileNames) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which contains
names of the file to be downloaded.java.lang.IllegalArgumentException
- If the specified vector is null.public java.io.InputStream getInpStream()
public java.lang.String getLocalDir()
public java.util.Vector getLocalFileList()
FileInfo
public java.lang.String getName()
public java.io.OutputStream getOutStream()
public java.lang.String getPortString()
protected java.beans.PropertyChangeSupport getPropertyChange()
public java.lang.String getRemoteDir()
public java.util.Vector getRemoteFileList()
FileInfo
public java.lang.String getRemoteOperatingSystem()
protected Remote getRemoteProtocol()
public boolean getRestartable()
public int getRestartCount()
setRestartCount(int)
public int getRestartCounter()
public java.lang.String getSocksProxyHost()
public java.lang.String getSocksProxyPort()
public java.lang.String getStatus()
public int getTimeout()
setTimeout(int)
public java.lang.String getType()
public boolean isStreamedInput()
public boolean isStreamedOutput()
public void list(boolean remote)
remote
- this boolean argument specifies whether the change directory
is for local machine or FTP server.public void login(java.lang.String userName, java.lang.String passwd) throws java.lang.IllegalArgumentException
userName
- user name of the user profile on the FTP server.passwd
- password of user profile on the FTP server.public void makeDir(java.lang.String dirName, boolean remote) throws java.lang.IllegalArgumentException
dirName
- name of the directory to be created.remote
- this boolean argument specifies whether the create directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the specified directory name is null.public void makeDirList(java.lang.String dirName, boolean remote) throws java.lang.IllegalArgumentException
dirName
- name of the directory to be created.remote
- this boolean argument specifies whether the create directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the specified directory name is null.public void passiveServer()
public void putFile(java.lang.String fileName) throws java.lang.IllegalArgumentException
fileName
- name of the file to be uploaded on to the FTP server.java.lang.IllegalArgumentException
- If the specified file name is null.public void putFile(java.lang.String fileName, java.lang.String remoteFileName) throws java.lang.IllegalArgumentException
fileName
- name of the file to be uploaded on to the FTP server.remoteFileName
- name of the target file to be uploaded on to the FTP server.java.lang.IllegalArgumentException
- If the specified file name is null.public void putFile(java.util.Vector fileNames) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which contains
names of the files to be uploaded on to the FTP server.java.lang.IllegalArgumentException
- If the specified Vector is null.public void putFileList(java.lang.String fileName) throws java.lang.IllegalArgumentException
fileName
- name of the file to be uploaded on to the FTP server.java.lang.IllegalArgumentException
- If the specified file name is null.public void putFileList(java.util.Vector fileNames) throws java.lang.IllegalArgumentException
fileNames
- Vector of objects of string type which contains
names of the files to be uploaded on to the FTP server.java.lang.IllegalArgumentException
- If the specified Vector is null.public void quote(java.lang.String param) throws java.lang.IllegalArgumentException
param
- - String value of specific command .public void removeDir(java.lang.String dirName, boolean remote) throws java.lang.IllegalArgumentException
dirName
- name of the directory to be deleted.remote
- boolean argument specifies whether the delete directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the specified directory name is null.public void removeList(java.lang.String dirName, boolean remote) throws java.lang.IllegalArgumentException
dirName
- name of the directory or file to be deleted.remote
- boolean argument specifies whether the delete directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the specified directory name is null.public void removeList(java.util.Vector dirNames, boolean remote) throws java.lang.IllegalArgumentException
dirName
- Vector of objects of string type which contains
names of the directories or files to be deleted.remote
- boolean argument specifies whether the delete directory
is for local machine or FTP server.java.lang.IllegalArgumentException
- If the specified directory name is null.public void removeLocalFileListListener(com.ibm.network.ftp.event.LocalFileListListener listener)
listener
- LocalFileListListener to be removed from LocalFileListListener listeners list.LocalFileListListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removeRemoteFileListListener(com.ibm.network.ftp.event.RemoteFileListListener listener)
listener
- RemoteFileListListener to be removed from RemoteFileListListener listeners list.RemoteFileListListener
public void removeStatusListener(com.ibm.network.ftp.event.StatusListener listener)
listener
- StatusListener to be removed from the StatusListener listeners list.StatusListener
public void rename(java.lang.String oldName, java.lang.String newName, boolean remote) throws java.lang.IllegalArgumentException
oldName
- name of the file to be renamed.newName
- new name of the file to be renamed.remote
- this boolean argument specifies whether the rename file
is for local machine or FTP server.java.lang.IllegalArgumentException
- If any of the newName or oldName parameters are null.public void renameList(java.lang.String oldName, java.lang.String newName, boolean remote) throws java.lang.IllegalArgumentException
oldName
- name of the file to be renamed.newName
- new name of the file to be renamed.remote
- this boolean argument specifies whether the rename file
is for local machine or FTP server.java.lang.IllegalArgumentException
- If any of the newName or oldName parameters are null.public void setBufferSize(int bufferSize)
bufferSize
- The new value for the property.getBufferSize()
protected void setBytesRead(int bytesRead)
bytesRead
- The new value for the property.protected void setBytesWrite(int bytesWrite)
bytesWrite
- The new value for the property.public void setInpStream(java.io.InputStream in)
userStream
- java.io.InputStreampublic void setName(java.lang.String newValue)
newValue
- java.lang.Stringpublic void setOutStream(java.io.OutputStream out)
userStream
- java.io.OutputStreampublic void setPortString(java.lang.String i)
protected void setRestartable(boolean restartable)
restartable
- booleangetRestartable()
public void setRestartCount(int restartCount)
restartCount
- The new value for the property.getRestartCount()
protected void setRestartCounter(int counter)
counter
- intpublic void setSocksProxyHost(java.lang.String socksProxyHost) throws java.lang.IllegalArgumentException
socksProxyHost
- domain name or the IP address of socksProxyHost.java.lang.IllegalArgumentException
- If the socksProxyHost argument is null.public void setSocksProxyPort(java.lang.String socksProxyPort) throws java.lang.IllegalArgumentException
socksProxyPort
- socksProxyPort as a String.java.lang.IllegalArgumentException
- If the socksProxyPort argument is null.public void setStreamedInput(boolean in)
in
- booleanpublic void setStreamedOutput(boolean out)
out
- booleanpublic void setTimeout(int timeout)
timeout
- The new value for the property.getTimeout()
public void setType(java.lang.String newType) throws java.lang.IllegalArgumentException
type
- data transfer type for the FTP connection.public void site(java.lang.String s)
s
- - String value of specific command .public void status()
public void system()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |