This concept can be used to execute FTP commands on specified FTP server.
This concept is able to login into a FTP server, view and change the working directory,
create, remove and list files and directories on the FTP server and change transefer mode
to ASCII and to BINARY mode.
$ftpCl typeof FTPClient
#open FTP conncetion to host in dir named directory
if ( $ftpCl.openConnection("ftp://hostName/dirName") ) then [
#login into FTP server using specified username and password
if ( $ftpCl.login("userName","passwd") ) then [
#rename oldDir directory to newDir
if $ftpcl.rename("/oldDirName", "/newDirName") then [
print "OK"
]
#show working directory
print $ftpcl.getWorkingDirectory
]
]
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML |
|
Label: | errorCode |
Type: | Integer |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Stores that error code with which the last executed command returned.
Label: | errorMessage |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | true |
Stores that error message with which the last executed command returned.
Parameters: |
$path : | The new directory path. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
FTPOperationWarning :
(Warning) | If can not change the working directory that is not exists. |
Returns true if the changing of the current working directory to the
directory specified in $path was successfull, false otherwise.
Exceptions: |
closeConnection :
(Error) | If an error occured when the FTPClient try to close the FTP connection.. |
Close the current connection.
Parameters: |
$path : | The path to the file or directory you want to delete. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
FTPOperationWarning :
(Warning) | If the directory is not exists. |
Deletes the file or directory specified by the $path.
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
Returns the specified $file's content.
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
Returns a series which contains all directories in the current working
directory.
Parameters: |
$path : | The path to the directory. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
Returns a series which contains all directories in the specified $path.
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
Returns the current working directory.
Returnes true if the error code is a positive complection response,
false otherwise.
Parameters: |
$userName : | The user's name with which to connect. |
$password : | The user's password with which to connect. |
|
Exceptions: |
loginWarning :
(Warning) | If you are not connected to FTP server.. |
loginFailed :
(Error) | If unable to login to FTP server, the FTP connection is closed. |
Returns true if the logging in with the specified $userName and
$password was successfull, false otherwise.
Exceptions: |
logoutFailed :
(Error) | If an error occured when you try to logout from the FTP server.. |
Returns true if the logging out was successfull, false otherwise.
Parameters: |
$path : | The path to the directory which will be created. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
FTPOperationWarning :
(Warning) | If the directory is already exists. |
Creates a new subdirectory on the FTP server in the current directory
(if a relative pathname is given) or where specified (if an absolute
pathname is given) and returns true if the directory creation was
successfull, false otherwise.
Parameters: |
$url : | The url to the remote host. |
|
Exceptions: |
missingHost :
(Error) | If missing a host name form URL. |
connectionRefuzed :
(Error) | If the FTP server refuzed connection. |
unsupportedProtocol :
(Error) | If the protocol is unsupported by the FTPClient.. |
badURL :
(Error) | If the URL isn't valid. |
Returns true if the connection to the remote host with the specified
$url was successfull, false otherwise.
Parameters: |
$fileName : | The file name which will be stored. |
$content : | The content of the stored file. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
Returns true if the store of the file was successfull, false otherwise.
Parameters: |
$oldName : | The name of the remote file to rename. |
$newName : | The new name of the remote file. |
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
FTPOperationWarning :
(Warning) | If can not rename the directory. |
Returns true if the renaming of the remote file was successfull, false
otherwise.
Parameters: |
$isBinary : |
The logical value to set. If true the file type will be set to binary,
if false the file type will be ascii.
|
|
Exceptions: |
FTPOperationFailed :
(Error) | If unable to execute FTP command on FTP server.. |
FTPOperationWarning :
(Warning) | If can not change transfer mode to binary. |
Sets the file type.